Booking (ID, DocID, shift_id, Date)
Shift table (ID, name, DocID)
select * from Shift where ID not in (select shift_id from Booking) and DocID =<specify id=""> and Date = <specify date=""> </specify></specify>
SELECT Shift.* FROM Shift LEFT OUTER JOIN Booking ON Shift.ID = Booking.shift_id AND Shift.DocID = Booking.DocID WHERE (Booking.ID IS NULL) OR (Booking.Date <> @VDate)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)