I have a table with a varchar2 field. The field contains '07/2012' with represents a month/year value. There are multiple dates in the table. I have a SELECT that is to read the table , comparing the date value against a date value input by the users. This is defined as DATE. The SELECT doesnt work. I keep getting ORA-01841: (full) year must be between -4713 and +9999, and not be 0.
THIS IS THE SELECT:
month_year is the table is definied as VARCHAR2(7)
from mytable where donor_number is null
and to_date(month_year, 'mm/yyyy') between to_date(v_from_date, 'mm/yyyy')
and to_date(v_to_date, 'mm/yyyy'));