Forums
This topic is locked
Find next "opening" in appointment table of bookings but no openings.
Posted 26 Jan 2009 09:20:14
1
has voted
26 Jan 2009 09:20:14 Mark Szlazak posted:
I have to work with a MS Access appointment table that only has records of booked appointments. There is an [Date] field for the date of the appointment, a [Time] field for the time of the appointment and a [Length] field for appointment length. So an appointment starts at [Date] + [Time] and ends at [Date] + [Time] + [Length]. If I want to find the next available 1 hour opening starting 24 hours from the present and on ward, I would need a way query the appointment table and check for any 1 hour or more "gaps" between consecutive records, assuming a table ordered by time.
What kind of sql string(s) would be need to accomplish this?
Thanks.