I have to calculate the difference in hours (decimal type) between two dates in SQL Server 2008.
I couldn\'t find any useful technique to convert datetime to decimal
DATEDIFF but note it returns an integer so if you need fractions of hours use something like this:-
CAST(DATEDIFF(ss, startDate, endDate) AS decimal(precision, scale)) / 3600