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 -> Re: date differnce

Re: date differnce

From: Scott Mattes <smattes_at_erols.com>
Date: Mon, 13 Nov 2000 11:05:50 -0500
Message-ID: <8up3fj$bka$1@bob.news.rcn.net>

Since Oracle date fields are really date and time, wouldn't this give wrong results under some conditions? I think that if you just wanted the diff in days you should trunc() each date.

Try this and see
SELECT SYSDATE, TO_CHAR( TRUNC( SYSDATE ), 'yyyy/mm/dd hh:mi:ss') FROM dual;

"Jeremy Russell" <jeremy.russell_at_usa.net> wrote in message news:CNQP5.13816$U4.754218_at_newsread1.prod.itd.earthlink.net...
> Try "SELECT higher_date - lower_date FROM table" - the result will be
> expressed in days.
>
>
> "LEPP" <ytgh_at_hotmail.com> wrote in message
> news:LtEP5.125342$j6.13218695_at_news1.rdc1.va.home.com...
> > What is the best method to get the differnce between 2 dates.
> >
> > Thanks
> > Lepp
>
>
Received on Mon Nov 13 2000 - 10:05:50 CST

Original text of this message

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