But the question is : Why are you trying to convert sysdate to a date? It is already a date and no conversion is necessary. The question is more for due_date. If it is a string, and needs to be converted to a date, then the format could be at fault. You need to know exactly what format the string field is holding the date in. For example, if due_date is holding a string such as '01-JAN-99', and you try to convert it to a date using the format 'MM-DD-YYYY', you will get the error you specified, because it is expecting a numeric DD and instead found the characters 'JA'.
Basically, if both fields are already dates, no conversion function is needed.
If they are strings, make absolutely sure that your pattern matches the format of the actual string values.
The default format for Oracle is 'DD-MON-YY'. Meaning, if you say
DECLARE
l_string VARCHAR2(10);
BEGIN
l_string := sysdate;
DBMS_OUTPUT.PUT_LINE ( l_string);
END;
Bookmarks