I have dates in different format :
Date 1 : 30-JAN-14
Date 2 : 2014-01-30 10:06:04.0
I am trying to compare the two dates using the following :
to_char(date2,'YYYY-MM-DD HH24:MM:SS') <> to_char(date1,'dd-MON-YY')
But it is giving the following error for the date1 part :
Lietral does not match format String
I tried comparing them directly
date2<>date1
I am gtting the same error again
EDIT : Date2 is varchar and Date1 is DATE
to_charon a character string, it would only make sense to callto_dateon character strings. Also, what would equality look like to you? Do you want to ignore the time component on the second value when comparing the two?