View Full Version : Need help with a query


nodtomc
04-22-2009, 01:36 AM
I'm creating a database which is a booking system for a guitar shop that offers lessons. I have a query which looks up lessons booked, but i need one that looks up ones that are not booked or "available". I've gone about it this way : Created a table with all time slots for the day, then created a query which looks up appointments that are not in the query of the booked appointments, so this means they are free. This is that query.

SELECT tblAvailableLessons.[Time of lesson]
FROM tblAvailableLessons, qryAppointmentsBooked
WHERE (((tblAvailableLessons.[Time of lesson])<>qryAppointmentsBooked.[Time of lesson]))

It works fine on the form which looks up the query, but say if i was to change the instructor, the query returns no data. It appears as though if an appointment has not previously been booked for that day or that instructor, no values are returned. I'm now stuck as to where to go, so if you could give me a point in the right direction it would be much apprieciated.

HiTechCoach
04-22-2009, 09:17 AM
Unfortunately I do not have a lot of time. I will see if I can help...


Created a table with all time slots for the day, ...

I would avoid doing this. I find it cause only more issues and make it harder.

This may help:
Clashing Events/Appointments (http://allenbrowne.com/appevent.html)

honda882000
04-23-2009, 09:34 AM
Can you post what qryAppointmentsBooked is doing?