|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Tuesday, May 07, 2013 3:30 AM
Points: 62,
Visits: 155
|
|
I have a Arrival date of 01/01/2012 the Departure date can be any date between 02/01/2012 and 29/01/2012 and needs to added to the database either via an Update/Insert Statement. Can you help with the code.
Thanks
Wayne
SELECT ArrivalDate, DATEADD(day, RAND(checksum(NEWID())) * LengthOfStay.LengthofStay, ArrivalDate) AS DepartureDate FROM Bookings, LengthOfStay ORDER BY ArrivalDate
But the Departure date cannot be the same as the arrival date.
|
|
|
|