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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Date conversion in plsql YYYYMM

Re: Date conversion in plsql YYYYMM

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Fri, 26 Mar 2004 06:15:52 -0500
Message-ID: <8uednSVdNbaXjPndRVn-ig@comcast.com>

"liglin" <liglinlillibli_at_hotmail.com> wrote in message news:db9bdb31.0403252224.28790926_at_posting.google.com...
| Thanks Michel,
|
| In the meanwhile I found still another solution:
|
|
| TO_DATE(TR.TR_BEG_DATE, 'YYYYMM01'
|
| converts a date into a date that begins with the first day of the
| month. Unfortunately, this presumes that the given date is 8 digits
| long. It won't work if the day is missing and the date consists of
| only 6 digits.
|
| Thanks,
|
| Liglin.
|
|

assuming that TR_BEG_DATE is date, see michel's columns assuming that TR_BEG_DATE is varchar2, then you've got a naming convention problem

in any case, TO_DATE definitely won't work if not used properly -- in general, the value being converted must match the format mask (implied of explicit), except for specific alternate conversions that are documented in the SQL manual under 'date formats'

;-{ mcs Received on Fri Mar 26 2004 - 05:15:52 CST

Original text of this message

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