使用DateDiff查找持续时间(分钟)

时间:2021-11-08 01:35:54

I am trying to use Datediff to find out the duration between columnA and columnB.

我试图使用Datediff找出columnA和columnB之间的持续时间。

SELECT datediff (minute, stime, etime)
from Exceptions2
where stime = [exceptions2].starttime
and etime = [exceptions2].endtime

This produces errors. Can anyone please help me with what I'm doing wrong?

这会产生错误。任何人都可以帮我解决我做错的事吗?

1 个解决方案

#1


26  

how about trying this, not sure why you have stime = [exceptions2].starttime and etime = [exceptions2].endtime

如何尝试这个,不知道为什么你有stime = [exceptions2] .starttime和etime = [exceptions2] .endtime

SELECT datediff(minute, starttime, endtime) from Exceptions2

#1


26  

how about trying this, not sure why you have stime = [exceptions2].starttime and etime = [exceptions2].endtime

如何尝试这个,不知道为什么你有stime = [exceptions2] .starttime和etime = [exceptions2] .endtime

SELECT datediff(minute, starttime, endtime) from Exceptions2