Jump to: navigation, search

Mysql LAST DAY

From w3cyberlearnings

Contents

MySQL LAST_DAY Function

This function returns the last date of the month.

Syntax LAST_DAY

  • expre: date or timestamp expression.
LAST_DAY(expre);

Example 1

mysql> SELECT LAST_DAY('2012-05-4');
+-----------------------+
| LAST_DAY('2012-05-4') |
+-----------------------+
| 2012-05-31            |
+-----------------------+
1 row in set (0.00 sec)

Example 2

mysql> SELECT LAST_DAY('2012-01-01 03:33:33');
+---------------------------------+
| LAST_DAY('2012-01-01 03:33:33') |
+---------------------------------+
| 2012-01-31                      |
+---------------------------------+
1 row in set (0.00 sec)

Related Links



Navigation
Web
SQL
MISC
References