我有两个日期值:08/6/2009 00:00:00
和10/6/2009 23:59:59
。
如何在SQL Server 2005中查询查询的小时数?
答案 0 :(得分:10)
SELECT DATEDIFF(hour, '2009-08-06 00:00:00', '2009-10-06 23:59:59')
---
71
答案 1 :(得分:1)
DATEDIFF(HOUR,'08/6/2009 00:00:00','10/6/2009 23:59:59')