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: Date difference function

Re: Date difference function

From: Dennis Heisler <dheisler_at_binghamton.edu>
Date: Mon, 10 Mar 2003 03:43:59 -0800
Message-ID: <F001.00564506.20030310034359@fatcity.com>


Just use subtraction. It will give you the difference in days.

SQL> select to_char(sysdate, 'dd-mon-rr hh24:mi') from dual;

TO_CHAR(SYSDATE,'DD-M



10-mar-03 06:43

SQL> select sysdate - to_date('09-mar-03') from dual;

SYSDATE-TO_DATE('09-MAR-03')


                  1.28016204

You can then convert the decimal portion to hours, minutes, seconds as you wish.

Dennis

> Santosh Varma wrote:
>
> Hello list,
>
> I want to find the difference between 2 dates..
> Any Oracle function for that ???
>
> Thanks and Regards,
> Santosh
>

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Dennis Heisler
  INET: dheisler_at_binghamton.edu

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Mon Mar 10 2003 - 05:43:59 CST

Original text of this message

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