Hi Everyone!
I am desperatly trying to write a query / view that will show available holiday dates, however i am a bit stuck and was wondering if someone kind would help me out.
Table Design:
id (autonumber)
start_date (datetime)
end_date (datetime)
available (yes / no)
Example Data:
#1, 05/03/2005, 12/03/2005, yes
#2, 12/03/2005, 18/03/2005, yes
#3, 15/03/2005, 17/03/2005, no
#4, 11/03/2004, 13/03/2005, yes
The output that i am trying to achieve from the query would be that records number 1,3 and 4 are returned. As record 3 cancels makes record 2 unavailable because it is within it's date range.
I hope this makes sense, any suggestions would be much appreciated as this is driving me nuts!! Thanks
I am desperatly trying to write a query / view that will show available holiday dates, however i am a bit stuck and was wondering if someone kind would help me out.
Table Design:
id (autonumber)
start_date (datetime)
end_date (datetime)
available (yes / no)
Example Data:
#1, 05/03/2005, 12/03/2005, yes
#2, 12/03/2005, 18/03/2005, yes
#3, 15/03/2005, 17/03/2005, no
#4, 11/03/2004, 13/03/2005, yes
The output that i am trying to achieve from the query would be that records number 1,3 and 4 are returned. As record 3 cancels makes record 2 unavailable because it is within it's date range.
I hope this makes sense, any suggestions would be much appreciated as this is driving me nuts!! Thanks