Curriculum
Course: MYSQL
Login

Curriculum

MYSQL

MySQL References

0/140
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”);