I have the data in table like below:
**start_date** **end_date**
--------------- -----------------
2011-06-27 13:24:45.137417 2011-06-28 05:34:26.54939
2011-09-30 09:09:00.501381 2011-10-03 23:38:46.479824
the expected result would be like below:
Diff
-------
0.16
3.14
where the digits before the decimal point is “Days” & after decimal point is “Hours”
i try it using
extract(‘epoch’ from (end_date-start_date))/(3600*24)
but it gives the “hours” value in format of 100 i.e 0.673395971909722 for the first record & 3.60400438012731 for second record
See formatting functions in the documentation.
Hope it helps.