Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Need to calc time between to dates in hours and minutes

Need to calc time between to dates in hours and minutes

From: DJordan532 <djordan532_at_aol.com>
Date: 17 Jul 1999 03:26:41 GMT
Message-ID: <19990716232641.20172.00001661@ng-da1.aol.com>


I need to calculate the difference between two dates and represent them in a query in hours and minutes. Additionally, I need to aggregate them into a column to use in calculating averages. Will be used in a PL/SQL package. I have used this below in my query and it works but it is not accurate:

start_dt = 16-JUL-99 15:10:00
end_dt = 16-JUL-99 15:41:00

select to_char((end_dt-start_dt)*(24*60),'990.99') elapsed from tablex;

returned valued is 30.90

The value I would like to see is 0:31 for 0 hours and 31 minutes.

I will appreciate all help. Received on Fri Jul 16 1999 - 22:26:41 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US