Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
Text lesson

LAST_DAY

Example

Retrieve the last day of the month for a specified date.

SELECT LAST_DAY(“2017-06-20”);

Definition and Usage

The LAST_DAY() function retrieves the final day of the month for a specified date.

Syntax

LAST_DAY(date)

Parameter Values

Parameter

Description

date

Mandatory. The date from which to retrieve the last day of the month.

Technical Details

Works in:

 From MySQL version 4.0

More Examples

Example

Get the last day of the month from the specified date.

SELECT LAST_DAY(“2017-02-10 09:34:00”);