Other related articles:

Recently viewed articles:

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:
sql last_day image1

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:
sql last_day image2
Note: The input string is not in date format but it conforms to date picture used by database.