Hi,

I am trying to get the months between 2 dates, however I think there is something wrong with my format and I couldn't get the result.

Two date fields namely : due_date, sysdate (both of DATE type)

SELECT MONTHS_BETWEEN (
TO_DATE(due_date,'MM-DD-YYYY'),
TO_DATE(sysdate,'MM-DD-YYYY') ) "Months"
FROM table_name
/

ORA-01858: a non-numeric character was found where a numeric was expected

Can anyone help me with the format please? Thanks! :)