Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Leading Zeros question - Help!
I am using the following script to get repair time for work orders. The script is working, but instead of format 00:00:00 (days, hours, minutes), if one of the calculations returns a number less than 10, I get 1:9:11 for 1 day, 9 hours, and 11 minutes, for example. In other words, I need to force a leading zero. THANKS in advance for any assistance!
Amanda Zaborowski
azaborow_at_mindspring.com
SELECT
Mod(TRUNC(((date_fixed - date_arrived) )*24), 1000) || ':'
||Mod( trunc(((date_fixed - date_arrived) )* 24*60),60) || ':'
||mod( TRUNC(((date_fixed - date_arrived) )* 24*60*60) ,60) AS REPAIR_TIME
FROM work_order
currently returns:
REPAIR_TIME
should return:
REPAIR_TIME
25:00:00 02:01:40 01:27:56 12:00:00Received on Sun Jun 03 2001 - 13:51:23 CDT
![]() |
![]() |