Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Format Number to Date
"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