Oracle: year must be between -4713 and +9999, and not be 0
Single quotes ('
) in SQL denote string literals. So 'hiredate'
isn't the hiredate
column, it's just a varchar, which, of course, doesn't fit the date format you're specifying. Just drop the quotes and you should be fine:
SELECT hiredate
FROM admin_emp
WHERE TO_DATE(hiredate,'yyyy-mm-dd') >= -- No quotes
TO_DATE('2012-05-12','yyyy-mm-dd');