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 with 'CONVERT' on MSDN.
Can anybody help me with that?
UPDATE:
To be clear, I need the fractional part as well (thus decimal type). So from 9:00 to 10:30 it should return me 1.5.
Using Postgres I had issues with DATEDIFF, but had success with this:
which gave me an output like "14.3"
DATEDIFF but note it returns an integer so if you need fractions of hours use something like this:-