I have a date column which I need to convert to character. But doing so it retrieves '00-000-00' even though the actual data has date value. Also, when I convert it again to date it gives the next day value.
For example:
Value: 25-MAR-17 (Date Datatype)
TO_CHAR(Value, 'DD-MON-YY'): '00-000-00'
TO_DATE(Value, 'DD-MON-YY'): '26-MAR-17'
And it's not happening for all the values but only the recent values.
Here is the Dump value present in that date column:
select OrderNumber, LoanDate, Dump(LoanDate) from OrderDetail
where OrderNumber=283402
OrderNumber| LoanDate | Dump(LoanDate)
283402 | 26-MAR-17 | Typ=12 Len=7: 120,117,3,27,0,15,40
Can you please explain me why these weird things happening and how to handle this?