views:

399

answers:

2

I have two date values: 08/6/2009 00:00:00 and 10/6/2009 23:59:59.

How do I get the difference in hours in a query in SQL Server 2005?

+5  A: 
SELECT  DATEDIFF(hour, '2009-08-06 00:00:00', '2009-10-06 23:59:59')

---
 71
Quassnoi
A: 

DATEDIFF(HOUR,'08/6/2009 00:00:00','10/6/2009 23:59:59')

JamesRyan