Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Days Between 2 Dates
A copy of this was sent to spotly_at_aol.comEatSpam (Spotly)
(if that email address didn't require changing)
On 20 Feb 2000 06:04:55 GMT, you wrote:
>I really have tried hard to figure this out. How do I get the number of days
>between sysdate and '26-FEB-2000'
>Thanks for any help. Tim H.
see http://osi.oracle.com/~tkyte/Misc/DateDiff.html for details but basically its:
ops$tkyte_at_8i> select trunc( sysdate-to_date('20-feb-2000', 'dd-mon-yyyy' ) ) from dual;
TRUNC(SYSDATE-TO_DATE('20-FEB-2000','DD-MON-YYYY'))
0
ops$tkyte_at_8i> c/20/15
1* select trunc( sysdate-to_date('15-feb-2000', 'dd-mon-yyyy' ) ) from dual
ops$tkyte_at_8i> /
TRUNC(SYSDATE-TO_DATE('15-FEB-2000','DD-MON-YYYY'))
5
--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
Thomas Kyte tkyte_at_us.oracle.com Oracle Service Industries Reston, VA USA
Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Sun Feb 20 2000 - 08:35:25 CST