如何在sql中获得时差
问题描述:
i有一张桌子看起来像:
Checkin ****** Ckeckout *****差异
--------------- --------------- -------------
8/19/2013 08:19 ***** 8/19/2013 10:19
8/19/2013 11:10 ***** 2013年8月19日12:19
在此我想要差异列中的签入列和结帐行列的区别...
Hi,
i have one table look like:
Checkin ****** Ckeckout ***** Difference
--------------- --------------- -------------
8/19/2013 08:19 ***** 8/19/2013 10:19
8/19/2013 11:10 ***** 8/19/2013 12:19
In this i want the difference of checkin column and checkout row column in Difference column...
答
试试这个。
选择DATEDIFF(MI,'8/19/2013 08:19','2013年8月19日10:19')
Try this.
select DATEDIFF(MI,'8/19/2013 08:19','8/19/2013 10:19')
>
您可以使用DATEDIFF函数计算差异,例如
You can calculate difference using DATEDIFF function like
DATEDIFF(option,'1997-12-31 23:59:59','1997-12-30')
http://forums.asp .net / t / 1188751.aspx / 1 [ ^ ]
希望它有所帮助..
http://forums.asp.net/t/1188751.aspx/1[^]
Hope it will help..