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: Jim Kennedy <kennedy-down_with_spammers_at_attbi.com>
Date: Tue, 04 Feb 2003 15:42:52 GMT
Message-ID: <0cR%9.162173$rM2.125663@rwcrnsc53>


is 24/01/72 January 24th 1972? In this day and age put in the century. Bad practice not to. So what your problem is that you are using VB's "date" functions and treating a date as a string. Alas why MS didn't make a date a real data type, but then again it is how MS works.

That MS date format has nothing to do with Oracle. Oracle doesn't have a clue what the heck 2678 is as a date. (Is that a Julian date? or the number of days since 1980?) Because it isn't a date, it is some MS propriatery internal date format. Convert it into a string that looks like a date in VB eg '24/91/1972' and then do a to_date('24/91/1972','dd/mm/yyyy') in your insert statement.

Jim

--
Replace part of the email address: kennedy-down_with_spammers_at_attbi.com
with family.  Remove the negative part, keep the minus sign.  You can figure
it out.
"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
Received on Tue Feb 04 2003 - 09:42:52 CST

Original text of this message

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