-
Hi,
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.
Thanks,
Muralee
[Edited by muralees on 02-28-2002 at 04:08 PM]
-
select round((date_end- date_start) * 24,0) hours_diff from dual;
-
Hi Muralees:
Try this:
select (end_date-start_date)*24 from table;
i.e
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.
hth
may$e
-
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.
Good luck.
David Knight
OCP DBA 8i, 9i, 10g
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|