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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Calculating # of days,hours,mins

RE: Calculating # of days,hours,mins

From: Jamadagni, Rajendra <rajendra.jamadagni_at_espn.com>
Date: Fri, 12 May 2000 16:38:44 -0400
Message-Id: <10495.105566@fatcity.com>


select record_id, to_char(sysdate-record_insert_timestamp, 'DD "Days", HH24 "Hours",
SELECT ROUND(rec_timestamp-SYSDATE) || ' Days '

         || TO_CHAR(TO_DATE(ABS(((rec_timestamp-SYSDATE) - ROUND(rec_timestamp-SYSDATE))*86400), 'SSSSS'), 'HH24') || ' Hours '

|| TO_CHAR(TO_DATE(ABS(((rec_timestamp-SYSDATE) -
ROUND(rec_timestamp-SYSDATE))*86400), 'SSSSS'), 'MI') || ' Minutes '

|| TO_CHAR(TO_DATE(ABS(((rec_timestamp-SYSDATE) -
ROUND(rec_timestamp-SYSDATE))*86400), 'SSSSS'), 'SS') || ' Seconds ' FROM dual

e.g.
  1 SELECT ROUND(SYSDATE+40/25-SYSDATE) || ' Days '   2 || TO_CHAR(TO_DATE(ABS(((SYSDATE+40/25-SYSDATE) - ROUND(SYSDATE+40/25-SYSDATE))*86400), 'SSSSS'), 'HH24') || ' Hours '   3 || TO_CHAR(TO_DATE(ABS(((SYSDATE+40/25-SYSDATE) - ROUND(SYSDATE+40/25-SYSDATE))*86400), 'SSSSS'), 'MI') || ' Minutes '   4 || TO_CHAR(TO_DATE(ABS(((SYSDATE+40/25-SYSDATE) - ROUND(SYSDATE+40/25-SYSDATE))*86400), 'SSSSS'), 'SS') || ' Seconds '   5* FROM dual
SQL> /   ROUND(SYSDATE+40/25-SYSDATE)||'DAYS'||TO_CHAR(TO_DATE(ABS(((SYSDATE+40/25-SY SDAT




2 Days 09 Hours 36 Minutes 00 Seconds Received on Fri May 12 2000 - 15:38:44 CDT

Original text of this message

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