I have two tables with two different date formats and I need to compare them. I am trying to convert the field Q_RATE_DATE; how do I change it from '27-JUN-12'
to 20120627
?
I tried:
TO_DATE(Q_RATE_DATE, 'DD-MON-YY', 'YYYYMMDD')
no luck, what am I doing wrong?
Actually it seems to me that BOTH columns are of character data type - otherwise it does not make sense to speak of "format." And in that case the correct solution is
to_char(to_date(Q_RATE_DATE, 'dd-mon-yy'), 'yyyymmdd')
(Well - actually the correct solution is to store dates in DATE data type, but it is entirely possible the OP has no control over that.)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments