Can anybody help me in this regard.
I have two date columns in a table like start_date and end_date
I want to find the diff between these two dates and get the result in number of hours.
I want the result in a single select statement.
[Edited by muralees on 02-28-2002 at 04:08 PM]
select round((date_end- date_start) * 24,0) hours_diff from dual;
select (end_date-start_date)*24 from table;
select (to_date('01-jan-02,'dd-mon-yy')-to_date('30-dec-01','dd-mon-yy'))*24 hrs from dual;
will return 48 hrs.
If you store the time at the Seconds level of granularity, you can use the fact that there are 3600 seconds per hour, and find the difference, do the division, and get your result.
OCP DBA 8i, 9i, 10g
Click Here to Expand Forum to Full Width