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: Natural Join B.V. <lex.de.haan_at_naturaljoin.nl>
Date: Thu, 22 Apr 2004 09:23:46 MET
Message-Id: <20040422072346.DE05711A5C0@ha-smtp2.tiscali.nl>


.. or, depending on the version you are using, use the ANSI/ISO standard EXTRACT function after the conversion to a valid date.

Cheers,
Lex.

> I'd do a to_date(stringdatecol, 'yyyy/mm/dd hh24') first of all, to make
> sure the data is at least a valid date. Then you could to_char(validdate,
> 'yyyy'), to_char(validdate, 'mm') to pull out the information you're
> interested in.
>
> ----- Original Message -----
> From: "Smith, Ron L." <rlsmith_at_kmg.com>
> To: <oracle-l_at_freelists.org>
> Sent: Wednesday, April 21, 2004 2:36 PM
> 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 Thu Apr 22 2004 - 02:23:43 CDT

Original text of this message

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