I am working on oracle table to pull the data. In one of the query i am using ‘where’ to filtering between date.
To_Date(VDATU,'DD-MON-YYYY') >= '03-Jun-2012'
AND To_Date(VDATU,'dd-mon-yy') <= '04-Sep-2012'
I am getting error,
ORA-01861: literal does not match format string
I tried using (‘dd-mm-yy’) but still it is giving the same error. what may the problem??
You are trying to convert
VDATU(which is presumably aVARCHAR2) into a date.In one place you have
DD-MON-YYYYand in the other you havedd-mon-yy.Which one is it?
VDATUcan not be valid for both.