I have a column with date string in yyyy-mm-dd format. How can I retrieve all rows which have a date <= 90 days. The date string is null for some of the entries. Some of those date strings are also not in the correct format. This is what I tried.
select * from MY_TABLE where b.ASSESSMENT_DATE IS NOT NULL AND (trunc(sysdate) - TO_date(b.ASSESSMENT_DATE, 'yyyy-mm-dd')) <= 90;
But it is giving me an error
ORA-01841: (full) year must be between -4713 and +9999, and not be 0
01841. 00000 - "(full) year must be between -4713 and +9999, and not be 0"
*Cause: Illegal year entered
*Action: Input year in the specified range