How Can We Help?
Introduction:
In this tutorial, we are going to explain how to use Oracle LAST_DAY function with basic syntax and many examples for better understanding.
LAST_DAY returns the last day of the month specified in the date.
Syntax:
LAST_DAY(date)
Name | Description |
date | The date you want to get next weekday to eg: sysdate. |
Applies to::
Oracle 19c, Oracle 18c, Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i
Examples:
Let’s take some examples about Oracle LAST_DAY and how to use it:
SELECT SYSDATE
,LAST_DAY(SYSDATE) "Last"
FROM DUAL;
SELECT (TO_DATE('13-01-2020', 'DD-MM-YYYY'))
,LAST_DAY(TO_DATE('13-01-2020', 'DD-MM-YYYY'))
FROM DUAL;
Similar functions to Oracle LAST_DAY:
ADD_MONTHS : Add number of months to a date.
NEXT_DAY : returns the date of the next weekday specified.
In this tutorial, you have learned how to use the LAST_DAY function to get the last day of the month on the date specified.
Hopefully, it was clear and concise.