Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Convert different date formats into the single date format

Vijayaraghavan KrishnanFeb 23 2010 — edited Mar 1 2010
Hi,

I have a different date formats in the varchar data type. The table has millions of records, I need to convert different type of date formats in to a common date format(yyyyMMdd).

I have wrote a SQL to convert the
SELECT SNO,DECODE(INSTR(DT,'-'),5,TRANSLATE(DT,'Z-','Z'),
                                0,DT,
                                3,TRANSLATE(TO_CHAR(TO_DATE(SUBSTR(DT,1,11),'DD-MON-YY'),'YYYY-MM-DD'),'Z-','Z')) AS "NEW DT",DT FROM TESTING
But it supports the only set of formats.

We have any thing to ignore those records and to continue with other records to convert in SQL or we need to do with the PLSQL alone.

Pls advise


Regards,
Vijayaraghavan K
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 29 2010
Added on Feb 23 2010
10 comments
2,587 views