问题描述
如何在两个日期字段之间获得超过3分钟
submit_date - dtm_AlarmStartTime是两个字段的日期
选择Incident_Number,dateadd(s,submit_date +'19800','19700101')为'submit_date',dateadd( S,dtm_AlarmStartTime + '19800', '19700101'),为 'dtm_AlarmStartTime',
(submit_date - dtm_AlarmStartTime),如从HPD_Help_Desk差分
其中DATEADD(S,submit_date + '19800' ,'19700101')> CONVERT(date,sysdatetime())
Hi,
How to get morethan 3minutes between two date fields
submit_date - dtm_AlarmStartTime are two fields date
select Incident_Number, dateadd(s,submit_date+'19800','19700101') as 'submit_date',dateadd(s,dtm_AlarmStartTime+'19800','19700101') as 'dtm_AlarmStartTime' ,
(submit_date - dtm_AlarmStartTime) as Difference
from HPD_Help_Desk where dateadd(s,submit_date+'19800','19700101') >CONVERT(date,sysdatetime())
推荐答案
SELECT * FROM MyTable WHERE DATEDIFF(mi, startDate, endDate) > 3
这篇关于如何在两个日期字段之间获得超过3分钟的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!