This content has been marked as final. Show 2 replies
'YY' means the first 2 digits will be the same as the first 2 digits of the current year. If you run that code in 2012, then '99' will be taken as short for 2099.
If you want '99' to mean 1999, then use 'RR' instead of 'YY'.
This shows one of the many reasons why storing date information in a VARCHAR2 column is such a bad idea. If you use a DATE column, the year is always indicated precisely.
TO_CHAR ( TO_DATE ( builddate , 'DD-MM-RR' -- Not 'DD-MM-YY' ) , 'YYYY-MM-DD' )