Hi there,
What I'm trying to do is the following:-
Query my database to show only the time-slots which haven't been used and populate it to a drop down box. (I know how to populate it to the drop down box.)
This is what I have:- (Tables)
Availability:-
AvailabilityTime
EmployeeId
Appointment:-
AppointmentTime
AppointmentDate
ClientID
EmployeeId
From researching around I'm pretty certain I need to have a join command in my SQL statement.
To me the logical way of doing this is that in order to achieve what I want I need to check the AvailabilityTime and employee ID against that in the appointments table and if there isn't a match that should mean that chosen appointment time is free so this gives grounds to display all available free slots.
The problem is I am not quite sure how to go about doing this SQLwise, any suggestions would be greatly appreciated!