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

Home -> Community -> Usenet -> c.d.o.server -> Re: Format Number to Date

Re: Format Number to Date

From: Paul Brewer <paul_at_paul.brewers.org.uk>
Date: Tue, 4 Feb 2003 19:30:07 -0000
Message-ID: <3e40201c_2@mk-nntp-1.news.uk.worldonline.com>


"Fred" <fpot_at_lucca.fr> wrote in message
news:66412593.0302032346.5a30eaec_at_posting.google.com...
> Thank you for your response and I will explain how the Date is in
> Oracle :
>
> In ASP, I have the date with this format : 24/01/72.
> To put the date in the field (NUMBER(6)), I do this operation :
> CLNG(24/01/72)
> When I want to write the date in ASP, I do : CDATE(26789)
>
> But, I want to do a request which group by month or by date, like :
>
> SELECT TO_DATE('24/01/03','MM') FROM MyTable
>
> My date is in the number format, so I should transformate 26789 in
> date format. I think that the request must be like :
>
> SELECT TO_DATE(TO_DATE(TO_CHAR(2678),'DD/MM/YY'),'MM') FROM MyTable

What is 26789 or 24/01/72 as a date? 1st day of 24th week in the year 72 BC? Or 26789 seconds since the last time Michael Jackson had a nose op?

Convert it to an unambiguous human-readable string (e.g. 'Jan 24, 1972'), then just use Oracle's to_date function.

Regards,
Paul Received on Tue Feb 04 2003 - 13:30:07 CST

Original text of this message

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