Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TO_DATE
Message
De
28/03/2001 04:48:23
 
 
À
23/03/2001 15:52:21
Jason Lanier
Ofs Brightwave Carrollton
Carrollton, Georgie, États-Unis
Information générale
Forum:
Oracle
Catégorie:
PL/SQL
Titre:
Divers
Thread ID:
00488244
Message ID:
00489354
Vues:
9
Well when you use the to_date it shows the value as a 2 char date.
You will need to use to_char again to get it back to a 4 char date.

Maybe this will explain:

create table test (sample_date date);
insert into test values (sysdate);

select TO_DATE(TO_CHAR(SAMPLE_DATE,'DD-MON-YYYY'),'DD-MON-YYYY' ) from test;
TO_DATE(T
---------
28-MAR-01
select TO_CHAR(SAMPLE_DATE,'DD-MON-YYYY') from test;

TO_CHAR(SAM
-----------
28-MAR-2001

update test set sample_date=TO_DATE(TO_CHAR(sysdate,'DD-MON-YYYY'),'DD-MON-YYYY' );
commit;

select TO_CHAR(SAMPLE_DATE,'DD-MON-YYYY') from test;
TO_CHAR(SAM
-----------
28-MAR-2001

You really are doing nothing wrong oracle just shows the dates as 2 characters.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform