SELECT
CASE
WHEN StartDate = BookedDate AND StartTime BETWEEN TimeSlotStart and TimeSlotEnd
THEN 'True'
ELSE 'False'
END
FROM
...
gbn
2009-04-15 10:02:56
SELECT
CASE
WHEN StartDate = BookedDate AND StartTime BETWEEN TimeSlotStart and TimeSlotEnd
THEN 'True'
ELSE 'False'
END
FROM
...
Why not simply:
WHERE Startdate = BookedDate AND StartTime <= TimeSlotEnd AND StartTime >= TimeSlotStart
?