两个日期时间值之间的差异 [英] Difference between two datetime value
本文介绍了两个日期时间值之间的差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hi,
I want to find total live time and dead time of every IP address of table.
Host IP DateTime Status
172.10.200.199 2010-07-13 13:16:42.530 Alive
172.10.200.199 2010-07-13 13:17:42.530 Alive
172.10.200.199 2010-07-13 13:18:42.530 Dead
172.10.200.199 2010-07-13 13:19:42.530 Alive
172.10.200.10 2010-07-13 13:16:42.530 Dead
172.10.200.10 2010-07-13 13:17:42.530 Dead
172.10.200.10 2010-07-13 13:18:42.530 Dead
172.10.200.10 2010-07-13 13:19:42.530 Alive
How to get total live and dead time of IP and show result look like.....
Host IP TolalLiveTime(hh:mm) TotalDeadTime(hh:mm)
172.10.200.199 00:02 00:01
172.10.200.10 00:01 00:02
Thanks in advance.......
推荐答案
我看不到您所拥有的数据怎么可能.其中一部分是,您只需对仍然存在的内容进行datediff.但是,如果他们死后没有时间,该如何解决?
I don''t see how that''s possible with the data you have. Some of it is, you just do a datediff on the ones that are still live. But, if you don''t have when they died, how can you work that out ?
这篇关于两个日期时间值之间的差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文