Hi,
Long time since I've been on here, not much database work being done....anyhow here goes.
I'm designing a small d/b that would allow 4 rooms to be booked out, by date (not time) and I want to prevent double bookings.
I've woked out the sort of furmula, but am not sure if it is 100% correct and more important how to write the code, either as a query or a vb code?
Formula:
(A) Booked room start date < Booked room end date
AND
(B) NEW Booking start date < NEW Booking end date
AND
(C) NEW Booking end date < Booked room start date
OR
(D) Booked room end date < NEW Booking start date
I think a booking is possible if A & B & C OR D is true
But would this allow for rooms to be used for 1 night and then the guest to move to another if that was available.....
...not sure if I am making myself clear here....HOPE you can help.
Ian
Long time since I've been on here, not much database work being done....anyhow here goes.
I'm designing a small d/b that would allow 4 rooms to be booked out, by date (not time) and I want to prevent double bookings.
I've woked out the sort of furmula, but am not sure if it is 100% correct and more important how to write the code, either as a query or a vb code?
Formula:
(A) Booked room start date < Booked room end date
AND
(B) NEW Booking start date < NEW Booking end date
AND
(C) NEW Booking end date < Booked room start date
OR
(D) Booked room end date < NEW Booking start date
I think a booking is possible if A & B & C OR D is true
But would this allow for rooms to be used for 1 night and then the guest to move to another if that was available.....
...not sure if I am making myself clear here....HOPE you can help.
Ian