Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: date differnce
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
![]() |
![]() |