1 Reply Latest reply on Feb 10, 2015 9:02 PM by rp0428

    Format Time Difference in HH:MI:SS


      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!

        • 1. Re: Format Time Difference in HH:MI:SS

          Wrong forum!


          This forum is for Sql developer questions only.


          Please mark the thread ANSWERED and repost it in the SQL and PL/SQL forum.

          SQL & PL/SQL


          The 'HH' in a format means 'hours' and so must be 12 or less.


          If you want a calculated value you will need to do the calculation yourself and then format. Oracle has no such bulit-in functionality.