Mysql Date Function
MySQL: DATE Function
This tutorial explains how to use the MySQL DATE function with syntax and examples.
Description
The MySQL DATE function extracts the date value from a date or datetime expression.
Syntax
The syntax for the DATE function in MySQL is:
Parameters or Arguments
- expression
The date or datetime value from which the date should be extracted.
Note
- If expression is not a date or a datetime value, the DATE function will return NULL.
- See also the CAST function.
Applies To
The DATE function can be used in the following versions of MySQL:
- MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0, MySQL 4.1.1
Example
Let's look at some MySQL DATE function examples and explore how to use the DATE function in MySQL.
For example: