tech on the net
Home About Us Feedback Site Map

Microsoft

Access Excel Word

Database

SQL Oracle / PLSQL SQL Server MySQL MariaDB PostgreSQL

Web Development

HTML CSS Color Picker

Language

C Language

More

ASCII Table Linux UNIX Java Clipart Joke of the Moment
Share this page:

Oracle/PLSQL: LAST_DAY Function

Learn how to use the Oracle/PLSQL LAST_DAY function with syntax and examples.

Description

The Oracle/PLSQL LAST_DAY function returns the last day of the month based on a date value.

Syntax

The syntax for the Oracle/PLSQL LAST_DAY function is:

LAST_DAY( date )

Parameters or Arguments

date is the date value to use to calculate the last day of the month.

Applies To

The LAST_DAY function can be used in the following versions of Oracle/PLSQL:

  • Oracle 12c, Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i

Example

Let's look at some Oracle LAST_DAY function examples and explore how to use the LAST_DAY function in Oracle/PLSQL.

For example:

LAST_DAY(TO_DATE('2003/03/15', 'yyyy/mm/dd')) would return Mar 31, 2003
LAST_DAY(TO_DATE('2003/02/03', 'yyyy/mm/dd')) would return Feb 28, 2003
LAST_DAY(TO_DATE('2004/02/03', 'yyyy/mm/dd')) would return Feb 29, 2004