SQL Double Booking System URGENT help needed!
Hey every1 - i am having a lot of trouble with this and any help would be much appreciated. I have an access 2003 database that i have created which is used primarily as a booking system for villas. I want to be able to design a system that prevents me from making a double booking. I have been advised that the best way of doing this is with a query. In english, i want the following out of my query:
Search through tblRentals for PropertyID that has just been entered
If the start date that has just been entered is >= to the start of any booking for this property, and the end date is <= to the end of any booking for this property, then display a message box "property double booked" and don't save any data.
OR
If the start date that has just been entered is <= to the start of any booking for this property, and the end date is >= to the end of any booking for this property, then display a message box "property double booked" and don't save any data.
OR
If the start date that has just been entered is <= to the start of any booking for this property, and the end date is <= to the end of any booking for this property, and the end date that has just been entered is > start date of any booking for this property, then display a message box "property double booked" and don't save any data.
OR
If the start date that has just been entered is >= to the start of any booking for this property, and the end date is >= to the end of any booking for this property, and the end date that has just been entered is < start date of any booking for this property, then display a message box "property double booked" and don't save any data.
OR
If the end date that has just been entered <= start of any booking for this property and the start date that has just been entered >= end of any booking for this property then display message box "booking successfull" and save data in tblRentals
WOW!!!! Lot of info there guys any help would be much appreciated. Fields in tblRentals are PropertyID, DateStart, DateEnd, and CustomerID. I am so confused about all of this!!!!!!!
Chris Smith
|