SQL LAST_DAY Function
SQL LAST_DAY function returns the last date in the same month as the date specified in the date argument.
The syntax is
LAST_DAY (date value);
Example:
The following SQL LAST_DAY Function will return last date for current month:
SELECT LAST_DAY (SYSDATE) FROM dual;
Output:
Example 2:
The following SQL LAST_DAY Function statement will return ‘2012-09-30’ as result
SELECT LAST_DAY('25-sep-2012') FROM dual;
Output:
Note: The input string is not in date format but it conforms to date picture used by database.