When I run this query:
SELECT * FROM tbl_person
WHERE to_date(date_create, 'dd/mm/yyyy') < to_date('01/01/2010', 'dd/mm/yyyy')
I hit the following error:
ORA-01841: (full) year must be between -4713 and +9999, and not be 0
To be clear, date_create field stored SYSDATE when I added into table. What I need is to retrieve data from tbl_person table starting from 01/01/2010 onward.
You don’t want to call TO_DATE on a DATE. Just use the date column in the query (and compare it to a date)