• I finally figured it out. It was the lack of a format mask on the date conversion. I changed

    to_date(LAST_UPDATED_DATE)

    to

    to_date(LAST_UPDATED_DATE, 'YYYY/MM/DD HH24:MI:SS)

    and now the code works.

    Rob