I've a query as below that's converting dates like (20190520,20050511,....) into 19700823.
SELECT NVL(TO_VARCHAR(ALIS.CYCAL_DATE::DATE,'YYYYMMDD'),'00000000')
FROM SCHEMA.VIEW.VIEWNAME_INDE ALIS
Regardless of the input dates, I'm getting output starting with 197008. I've seen last two digits differ for some dates
I'm aware of TO_VARCHAR(TO_DATE(ALIS.CYCAL_DATE,'YYYYMMDD'),'DDMMYYYY'). I just want to know the cause of this faulty conversion. If you've seen this or know the cause, please share.