需要一些帮助来验证这是获得结果的正确方法。我需要找到日期的秒部分 > 0 的两个日期之间的分钟差异。
过去一分钟的列表,Variance = (Event_BeginTime - Event_CreateDate) 其中 HH:MM:SS 的秒部分 > 0
SELECT Event_BeginTime
,Event_CreateDate
,DATEDIFF(MINUTE,Event_BeginTime,Event_CreateDate) AS 'Variance'
FROM Events WITH (NOLOCK)
WHERE RIGHT(CAST(Event_BeginTime AS TIME(0)), 2) > 0 AND Event_CreateDate >= DATEADD(MINUTE, -1, GETDATE())
ORDER BY Event_CreateDate DESC