Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Format Time Difference in HH:MI:SS

jamphanFeb 10 2015 — edited Feb 11 2015

I am trying to get the time difference between 2 dates and format them in HH:MI:SS.  I am using this formula

to_char(to_date('00:00:00','HH24:MI:SS') +  (DECISION_DT - INITIATION_DT), 'HH24:MI:SS') which works fine until the difference is more than 24 hours.  For example if the INITITIATION_DT is 08-FEB-15 08:00:00 and the DECISION_DT is 10-FEB-15 10:05:10 I would want the time difference to be 50:05:10 or 50 hours 5 minutes and 10 seconds.  Any help is greatly appreciated!

This post has been answered by Frank Kulash on Feb 10 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 11 2015
Added on Feb 10 2015
3 comments
2,905 views