我有两个日期值:08/6/2009 00:00:00 和 10/6/2009 23:59:59。
08/6/2009 00:00:00
10/6/2009 23:59:59
在 SQL Server 2005 查询中,如何获取小时差异?
SELECT DATEDIFF(hour, '2009-08-06 00:00:00', '2009-10-06 23:59:59') --- 71
DATEDIFF(HOUR,'08/6/2009 00:00:00','10/6/2009 23:59:59')