31

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

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

这会产生错误。谁能帮我解决我做错了什么?

4

1 回答 1

49

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

SELECT datediff(minute, starttime, endtime) from Exceptions2
于 2010-11-01T21:53:16.820 回答