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

Home -> Community -> Usenet -> c.d.o.misc -> Re: datediff

Re: datediff

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Thu, 13 Sep 2001 11:58:36 +0200
Message-ID: <9nq00c$v5d$1@s1.read.news.oleane.net>

"Jean" <ken_jean_at_hotmail.com> a écrit dans le message news: 9nptaf$t3i$1_at_serv1.iunet.it...
> Hi to all!!!
> I'm new in oracle.
> I need to have a difference between current date and a datetime field that I
> have in a table.
> How I can do this?
> In SQL Server exist a function called DateDiff that make this.
> And in Oracle what is solution?
>
> Thanks a lot in advance.
> Bye
>

With Oracle there is - (minus):
date2-date1=nb of days between the two dates (float number). For example, nb of days since beginning of the year:

v817>select to_date('13/09/2001 11:56:10','DD/MM/YYYY HH24:MI:SS')   2 -to_date('01/01/2001 00:00:00','DD/MM/YYYY HH24:MI:SS') diff   3 from dual;

      DIFF



255.497338
--
Have a nice day
Michel
Received on Thu Sep 13 2001 - 04:58:36 CDT

Original text of this message

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