Re: Date Help
Date: Wed, 12 Feb 2003 21:44:00 +0100
Message-ID: <5ccl4vo575340mp8qv21i6k7k9k4spg202_at_4ax.com>
On Wed, 12 Feb 2003 19:47:53 GMT, "KW" <runamok_at_sbcglobal.net> wrote:
>Hi,
>
>I have a file that give me a reference date as the number of days since
>1/1/985. So if I know I am starting with the date 2/13/2003 and run:
>
>select (TO_DATE('02/12/2003' , 'MM-DD-YYYY') - (TO_DATE('01/01/1985',
>'MM-DD-YYYY'))) "Days"from dual
>
>I receive 6616.
>
>That matches the file I have with the number 6616 in it.
>
>So - now I need to say: I know I have a number 6616 and it is the number of
>days since 1/1/985. How do I convert the 6616 BACK into 2/13/2003? I
>probably have to do a bit of math but seem to be at a loss.
>
>Any help is appreciated,
>
>Kevin
>
>
Think about it: You have just subtracted 2 dates. You got a number. Question: can you add a date and a number? Sure you can!
select to_char(
To_date('01011985','ddmmyyyy') + 6616, 'dd-mm-yyyy') from dual
Sybrand Bakker, Senior Oracle DBA
To reply remove -verwijderdit from my e-mail address Received on Wed Feb 12 2003 - 21:44:00 CET