Home » RDBMS Server » Server Administration » Date Calculation
Date Calculation [message #371337] Wed, 04 October 2000 14:04 Go to next message
Salman Khan
Messages: 51
Registered: September 2000
Member
Hi,

Iam calculating dates like this

select to(sysdate) - to_date('03-oct-00') from dual
its return me 1 but I want this in Hours,
How can i do this

Any idea?

Thanks in advance
Salman Khan
Re: Date Calculation [message #371344 is a reply to message #371337] Thu, 05 October 2000 09:34 Go to previous messageGo to next message
Highlander
Messages: 5
Registered: October 2000
Junior Member
SELECT (TO_DATE(SYSDATE) - TO_DATE('03-oct-00')) * 24 FROM dual
Re: Date Calculation [message #371346 is a reply to message #371337] Thu, 05 October 2000 11:58 Go to previous message
Andrew again...
Messages: 270
Registered: July 2000
Senior Member
To get just the hours (and not fractions too) you can add a trunc() to the result, also - no need to perform a to_date(sysdate)
select trunc((sysdate - to_date('03-OCT-00'))*24) from dual;
Previous Topic: DECODE - help!!
Next Topic: ORA - 02291
Goto Forum:
  


Current Time: Tue Apr 23 22:42:14 CDT 2024