I have an arrival date already in the system and I need to populate the Booking date using a random function, the booking date can be any day on or before the arrival date up to a maximum 90 days previous but it must be random the booking date cannot all be the same date.
I thought I cracked it but was wrong. Can you help?
SELECT ArrivalDate, DATEADD(day, -1 + RAND(checksum(NEWID()))-90
, ArrivalDate) AS BookingDate
ORDER BY ArrivalDate