Posted on 2013-12-04
Showing an error message for user when end_date is less than start_date
I am using the format MM/RRRR as start_date
and MM/RRRR as end_date.
Using the below I get the end_date.
select to_char(last_day(to_date('10/2013','mm/yyyy')),'dd-mon-yyyy') from dual
If the user enters 10/2013 for start_date and 09/2013 for end_date, I need to tell its an error- end date has to be greater than start date.
How can I have the code. I tired using
TO_CHAR(:end_date,'DD-MON-YYYY') < TO_CHAR(:start_date,'DD-MON-YYYY')
but it does not work. Need to convert to date.