LAST_DAY

The Oracle and PLSQL LAST_DAY function returns the last day of the month based on a date value.

LAST_DAY(d)

Example 1:

SELECT LAST_DAY(TO_DATE('31/10/2007','DD/MM/YYYY')) FROM DUAL;

returns:

31/10/2007