Last Day Last Month - Query Assistance

From: master44 <>
Date: Fri, 31 Jul 2009 16:36:41 -0700 (PDT)
Message-ID: <>

I put a query together to pull the last day of last month that has worked fine for the last 2 months, but suddenly failed today now that the date is the 31st of the month:

SELECT TO_DATE(TO_CHAR(LAST_DAY(SYSDATE + numtoyminterval(-1, 'MONTH')), 'YYYY-MM-DD'), 'YYYY-MM-DD') FROM DUAL What am I doing wrong??

Eunning this against a Oracle 10G database, sorry don't know the exact version. Received on Fri Jul 31 2009 - 18:36:41 CDT

Original text of this message