Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Oracle date format question

Re: Oracle date format question

From: Guang Mei <gmei_at_incyte.com>
Date: Wed, 21 Apr 2004 14:45:26 -0400
Message-ID: <NJEDKDKJDGAKAEKKNEEJEEPFDBAA.gmei@incyte.com>


update table
set new_year_column = substr(old_column,1,4),

    new_month_column = substr(old_column,6,2);

commit;

Guang

-----Original Message-----

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org]On Behalf Of Smith, Ron L. Sent: Wednesday, April 21, 2004 2:36 PM
To: oracle-l_at_freelists.org
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_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Wed Apr 21 2004 - 13:41:26 CDT

Original text of this message

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