ORA-01722: Invalid Number Caused by to_char

  • This might be caused by running to_char on a timestamp like this: to_char(dp.calc_date, ‘dd/Mon/yyyy hh:mi:s’).
  • Try just returning the date without trying to convert it first.
  • More about this error here.