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

Home -> Community -> Usenet -> c.d.o.tools -> Leading Zeros question - Help!

Leading Zeros question - Help!

From: Amanda Zaborowski <azaborow_at_mindspring.com>
Date: Sun, 3 Jun 2001 14:51:23 -0400
Message-ID: <9fdv88$o2p$1@slb3.atl.mindspring.net>

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



25:0:0
2:1:40
1:27:56
12:0:0

should return:
REPAIR_TIME


25:00:00
02:01:40
01:27:56
12:00:00
Received on Sun Jun 03 2001 - 13:51:23 CDT

Original text of this message

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