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!

Oracle 10g - Convert decimal to HH:MM beneed 10 min

MarverJan 4 2019 — edited Jan 4 2019

SQL> SELECT TRUNC(2.75) || 'hrs:' ||
       extract (minute from numtodsinterval(2.75, 'HOUR' )) || ':'
  FROM dual

Gives as result 2:45 = OK

SQL> SELECT TRUNC(2.15) || 'hrs:' ||

       extract (minute from numtodsinterval(2.75, 'HOUR' )) || ':'

  FROM dual

Gives as result 2:9 but has to be 2:09

How do i get the zero before all values beneed 2.17?

This post has been answered by BEDE on Jan 4 2019
Jump to Answer
Comments
Post Details
Added on Jan 4 2019
13 comments
5,710 views