The following query displays all free time slots for a specific which haven’t been booked:-
SELECT DISTINCT tbl_available.timeslot
FROM tbl_appointment RIGHT JOIN
tbl_available ON (tbl_appointment.employeeID = tbl_available.employeeID) AND (tbl_appointment.apptTime = tbl_available.timeslot)
WHERE tbl_appointment.apptTime IS NULL
ORDER BY 1;
This is fine but I’m trying to get it so that it runs this query based on any date which is passed in as a parameter using c#. (I only need help with the SQL side of things)
Using the following tables:-
Appointment:- Availability:-
apptTime timeSlot
apptDate DoctorId
patientID
Any suggestions would be greatly appreciated.
1 Answer