如何在sql中获得时差 [英] How to get the time difference in sql

查看:121
本文介绍了如何在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..


这篇关于如何在sql中获得时差的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆