早晚班/由零點到現在共幾分鐘

 


SELECT DATEDIFF(minute, convert(varchar, GETDATE(), 111), GETDATE());



CASE

    WHEN DATEDIFF(minute, convert(varchar, CallDate, 111), CallDate) < 450 THEN 'night'

    WHEN DATEDIFF(minute, convert(varchar, CallDate, 111), CallDate) > 1129 THEN 'night'

    ELSE 'morning'

END AS 班別 ,

留言

熱門文章