Re: Oracle date format question

  • From: "Guang Mei" <gmei@xxxxxxxxxx>
  • To: "Oracle-L-freelists" <oracle-l@xxxxxxxxxxxxx>
  • Date: Wed, 21 Apr 2004 14:45:26 -0400

update table
set new_year_column = substr(old_column,1,4),
    new_month_column = substr(old_column,6,2);

-- check your cloumn values, if correct

commit;


Guang

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx
[mailto:oracle-l-bounce@xxxxxxxxxxxxx]On Behalf Of Smith, Ron L.
Sent: Wednesday, April 21, 2004 2:36 PM
To: oracle-l@xxxxxxxxxxxxx
Subject: Oracle date format question


I have a varchar column with data in the format yyyy/mm/dd hh .
I need to pull the year and the month into separate fields so I can
select and group them.
Can anyone tell me the easiest way to do this?



----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to:  oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at //www.freelists.org/archives/oracle-l/
FAQ is at //www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------

Other related posts: