| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Date conversion in plsql YYYYMM
"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
![]() |
![]() |