Nico2011
asked on
Search MS SQL DB for available dates
Hello Experts,
I'm working on a booking engine and would like to know if anyone knows the best way to search a db for availability. For example, a customer could search for July 1st 2012 +/-7 days, for a 7 day stay, so the query needs to check that there is no booking, either between the June 24th to July 1st, or June 25th to July 2nd, or June 26th to July 3rd etc., right up to July 7th to July 14th.
My DB at the moment has start and end dates, but I'm simply not sure of the best way to do this...!
Please help! Thanks :-)
I'm working on a booking engine and would like to know if anyone knows the best way to search a db for availability. For example, a customer could search for July 1st 2012 +/-7 days, for a 7 day stay, so the query needs to check that there is no booking, either between the June 24th to July 1st, or June 25th to July 2nd, or June 26th to July 3rd etc., right up to July 7th to July 14th.
My DB at the moment has start and end dates, but I'm simply not sure of the best way to do this...!
Please help! Thanks :-)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER