Tuesday, 10 September 2013

Returning all items that do not overlap existing time periods in Access

Returning all items that do not overlap existing time periods in Access

In Microsoft access, I have two queries. One that returns complete list of
rooms, and one that returns a list of when those rooms are taken (can
contain duplicates, all rooms have not necessarily stayed in so it may not
contain every room). How can I now create a query that will display all
the rooms not occupied within a given period of time? So far to compare
the dates I have:
(([Taken Room Times].[Start Date])<=[Forms].[Create Booking].[Finish Date]
And [Forms].[Create Booking].[Start Date]<=[Taken Room Times].[Finish
Date])
(based on this Determine Whether Two Date Ranges Overlap) If this returns
false then the periods do not overlap, and the query should return that
room.

No comments:

Post a Comment