datetime - SQL Server 2012 Time Range Check? -
what smart way determine if current time between 59th minute of hour , first minute of next hour, using pure tsql on mssql 2012? i not want cut off time "now", want cut off date , time calculation. this gets me kind of close : datepart time between (instead of convert date) not since need calculate based on current time , not table values. the following might illustrate if server in "the bad time" , should return value of '1' 14:58:59 , should not considered in "bad time" 14:59:00 , should considered in "bad time" 14:59:04 , should considered in "bad time" 14:59:57 , should considered in "bad time" 15:00:02 , should considered in "bad time" 15:01:26 , should not considered in "bad time" 15:02:00 , should not considered in "bad time" 15:02:01 , should not considered in "bad time" thanks. edit: this code works, sure can done more efficiently. recommendati...