Forum Replies Created

Viewing 15 posts - 16 through 30 (of 42 total)

  • RE: Update query will not run?

    Hi Dwain

    I have tried to breakdown what I need below, I hope this helps.

    Thanks

    Wayne

    Step 1

    Arrival Date (Already generated) – 1.35 Million Times

    Step 2

    Randomise a number between 0 and 1

    Step...

  • RE: Update query will not run?

    Hi Dwain

    Thanks for the link but to be honest its way above where I am in my training (I'm 4 weeks in) and to be honest that looks like a...

  • RE: Update query will not run?

    I have just been told I have done it completely wrong by my boss and the query above hasn't randomised anything on our data, I have got 48000 records with...

  • RE: Creating a BookingDate using a random function

    Its alright I have figured it out:

    SELECT ArrivalDate, DATEADD(day, -1 + RAND(checksum(NEWID()))*-90

    , ArrivalDate) AS BookingDate

    FROM Bookings

    ORDER BY ArrivalDate

  • RE: Case Statement Issue

    Thanks everyone all sorted now.

  • RE: Case Statement Issue

    Hi Gazareth

    Thanks for your help, I should have known to change the start date to the date I wanted, I have done this now

    CASE

    WHEN YEAR(@StartDate) = 2010 AND (SELECT SiteWeighting...

  • RE: Case Statement Issue

    Hi Gazareth

    I am getting the following error message, Msg 206, Level 16, State 2, Line 32

    Operand type clash: int is incompatible with date. Also as you can see from the...

  • RE: Case Statement Issue

    Thanks everyone, I have sorted it now with your help (See below for final code), however I now need to populate the table with 4 more years worth of dates...

  • RE: Case Statement Issue

    Site Table

    Site_SkeySiteCodeSiteNameBDMRegionSiteWeighting

    16000AdgestoneRoger GreenEast1

    26001Aldridge HillRoger GreenEast4

    36002Alton The StarRoger GreenEast4

    46003ArdgartenRoger GreenEast1

    56004AshbourneRoger GreenEast1

    66005AshurstRoger GreenEast1

    76006BakewellRoger GreenEast2

    86007BalaRoger GreenEast1

    96008Barnard CastleRoger GreenEast3

    106009Beadnell BayRoger GreenEast2

    Site Table

    PitchType_SkeyPitchTypeCodePitchDescriptionPitchTypeWeighting

    11Grass4

    22Grass With Electric3

    33Hardstanding2

    44Hardstanding With Electric4

    55Self Catering1

    66Pods/Dens1

    77Seasonal1

    It was in table form but it looks...

  • RE: Case Statement Issue

    This is the complete code:

    CREATE TABLE Capacity

    (StartDate DATE not null,

    EndDate DATE not null,

    Quantity INT not null,

    PitchType_Skey int not null,

    Site_Skey int not null)

    DECLARE @PitchType_Skey INT

    DECLARE @Site_Skey INT

    DECLARE @Capacity INT

    DECLARE @StartDate DATE

    DECLARE...

  • RE: Case Statement Issue

    Hi Sean

    Thank you for that, but it still doesn't populate my table. Any ideas why not because I haven't got the foggiest?

    DECLARE @PitchType_Skey INT

    DECLARE @Site_Skey INT

    DECLARE @Capacity INT

    DECLARE @StartDate DATE

    DECLARE...

  • RE: Case Statement Issue

    I have a Site Table that has a Site Weighting Column, each Site is weighted between 1 and 4, I am currently working on the Capacity table and want to...

  • RE: Sort by/Order By

    Thank you everyone, all you input has invaluable and I know where to come with my next problem which will be Monday without a doubt.

    Speak soon have a good weekend.

  • RE: Sort by/Order By

    Hi Lynn

    Yes I knew that, the questions isn't really about about querying the data, I know there are plenty of ways to get the information from a query. What the...

  • RE: Sort by/Order By

    Hi Chris

    Not exactly like the FinancialMonth line just something similar.

    Thanks

    Wayne

Viewing 15 posts - 16 through 30 (of 42 total)