Time Slot Query

carlton123

Registered User.
Local time
Today, 09:13
Joined
Mar 18, 2011
Messages
48
I have a mismatch Query that shows time slots available during day that have not been booked (15 minute intervals) the problem I have i want to just show the time slots that are available depending on what treatment has been chosen so if it was a one hour appointment then it checks that 4 slots available in a row and just displays that

Available
11:00
11:15
12:00
12:15
12:30

Thanks for any help on how I would try to do this
12:45
13:00
13:15
13:30

so would show for a 1 hour appoinment
12:00
12:15
12:30
 
Are you not missing one = 12:45?
Because you have an available time 13:30, (13:30 + 15 minutes = 13:45)!
 
Yes but this is just an example so is this not possible?
 
You are going to need a loop and a temporary table or maybe an array. I like temporary tables, but I'm probably set in my ways.
The loop has to subtract the current record's time from the next record's time. Based on criteria you set it will either append the current record to the table or it will skip it.
 
it will be tricky I think.

one way to do this might be to work on the full slots - so establish the slots that are full, and whatever remains is therefore a permitted slot.

if you can find a demonstration hotel booking app, this would be useful, it's the same principle. in order to book a given range of dates, you need to be sure that there are vacancies for each date of the stay.
 
im looking at doing a loop I did it to a table but i could not reference that table in a query after or im missing something!

thanks for your help
 
I've made 2 solutions for you, one fill a listbox in a form and one using a UDF in a query.
 

Attachments

I've made 2 solutions for you, one fill a listbox in a form and one using a UDF in a query.

Wow thank you so much this does everything i need I have modified slightly to allow longer appointments, I have gone with filling the Listbox solution thanks again :):):):):)
 
You're welcome, luck with your project.
 

Users who are viewing this thread

Back
Top Bottom