|
wafw1971
Yak Posting Veteran
75 Posts |
Posted - 02/20/2013 : 09:13:01
|
0down votefavorite
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 a 2 night stay, 48000 records for a 27 night stay etc.
What I need is 30% of the departure dates to be 2 days in length, 10% of the departure dates to be 3 Days in length and the rest to be randomised amongst 1, 4 to 28. I know it involves case statement but I don't know how to do them.
Can anyone help? Update bookings Set DepartureDate = DATEADD(day, 1 + RAND(CHECKSUM(NEWID()))*28, ArrivalDate) SELECT * FROM bookings
Thanks
Wayne
|
|