Simple demo for LAST_DAY function
SQL> SQL> SQL> --The LAST_DAY function returns the last day of any month SQL> SQL> SELECT TO_CHAR(LAST_DAY('23SEP2006')) FROM dual; TO_CHAR(L --------- 30-SEP-06 SQL> SQL>