LAST_DAY(x): get the date of the last day of the month that contains x.
SQL> SQL> SELECT LAST_DAY('01-JAN-2005') FROM dual; LAST_DAY( --------- 31-JAN-05 SQL>