I have a calendar, which the customers will use to choose a date, when the date is chosen a popup appears with a dropdown menu with the working hours, if all employees are busy at the particular time I want it to be removed from the drop down menu
this is what I have so far
( select WorkingHours from WorkingHours
except
(select StartTime from Assign_Staff,Schedule1
where Assign_Staff.ScheduleId=Schedule1.ScheduleID and
exists (select ScheduleID,StartTime from Schedule1 where Date='2016-08-16'))
) ( select distinct StaffID, WorkingHours from Staff,WorkingHours
except
(select StaffID,StartTime from Assign_Staff,Schedule1
where Assign_Staff.ScheduleId=Schedule1.ScheduleID and
exists (select ScheduleID,StartTime from Schedule1 where Date='2016-08-16'))
)
my tables: schedule table contains (ID, date, start_time,end_time,Customerid) appointment_Staff (id, ScheduleID, staffID,AdminID) working_Hours (id,start_time,end_time)
What I have tried:
I can't figure it out