Declare @TimeStamp Datetime, @Result int If @TimeStamp in ('6:00:00 P.M' and '5.59.59 A.M') ==> Return @Result = 1 (It's mean true) else return Result = 0 (It's mean flase)
select case when datepart(hour, @TimeStamp) >= 6 and datepart(hour, @TimeStamp) < 18 then 'Day' else 'Night' end
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)