7 To 9
DECLARE @startDate datetime = DateAdd(hour, 7, DateAdd(day, 0, cast(floor(cast(getdate() as float))as datetime)))
DECLARE @endDate datetime = DateAdd(hour, 7+5+9, DateAdd(day, 0, cast(floor(cast(getdate() as float))as datetime)))
Select @startDate as startDate
Select @endDate as endDate
IF (@startDate >= GETDATE() and GETDATE() <= @endDate)
BEGIN
Print 'true'
END
ELSE
BEGIN
Print 'false'
END
DECLARE @startDate datetime = DateAdd(hour, 7, DateAdd(day, 0, cast(floor(cast(getdate() as float))as datetime)))
DECLARE @endDate datetime = DateAdd(hour, 7+5+9, DateAdd(day, 0, cast(floor(cast(getdate() as float))as datetime)))
Select @startDate as startDate
Select @endDate as endDate
IF (@startDate >= GETDATE() and GETDATE() <= @endDate)
BEGIN
Print 'true'
END
ELSE
BEGIN
Print 'false'
END
Comments
Post a Comment