SQLTeam.com | Weblogs | Forums

I want Select ShiftNo


#1

ID StartShift EndShift ShiftNo
1 10:00:01 22:00:00 1
2 22:00:01 10:00:00 2

DECLARE @timenow time
SET @timenow = '01:35:00'

i want Select ShiftNo


#2
SELECT ShiftNo FROM YourTable
WHERE 
   StartShift <= @timeNow
   AND EndShift >= @timeNow;