[thelist] Oracle Date Swizzle?

Plunkett, Matt MPlunkett at MSA.com
Tue Aug 26 11:44:15 CDT 2003


begin
    dbms_output.put_line(TO_CHAR(TO_DATE('20031225', 'YYYYMMDD')));
end;

prints out 25-Dec-2003 for me.

So, TO_DATE('20031225', 'YYYYMMDD') should do the trick to throw that string
into a date.

-----Original Message-----
From: Luther, Ron [mailto:ron.luther at hp.com]
Sent: Tuesday, August 26, 2003 12:17 PM
To: List (E-mail)
Subject: [thelist] Oracle Date Swizzle?


Hi Gang,

I've got a *text* field in a database populated with values like '20031225'
that I need to do a little 
date arithmetic on.

I'm using an older version of Oracle.

Any handy-dandy simple solutions?


Thanks,

RonL.
[Currently eyeball deep in "TO_DATE(TO_CHAR(SUBSTR (
Open_Detail.Customer_Dt, 5, 2 )) || CHR(45) || 
TO_CHAR(SUBSTR ( Open_Detail.Customer_Dt, 7, 2 )) || CHR(45) ||
TO_CHAR(SUBSTR ( 
Open_Detail.Customer_Dt, 1, 4 )), 'MM-DD-YYYY')" nonsense that doesn't seem
to be properly cutting 
the cheese. Grrr.]


-- 
* * Please support the community that supports you.  * *
http://evolt.org/help_support_evolt/

For unsubscribe and other options, including the Tip Harvester 
and archives of thelist go to: http://lists.evolt.org 
Workers of the Web, evolt ! 


More information about the thelist mailing list