DATE() FUNCTION in MySQL

DATE() FUNCTION The MySQL DATE function is used to extract the date value from a date or datetime expression. The various versions of MySQL support the DATE function, namely, MySQL 5.7, MySQL 5.6, MySQL 5.5, MySQL 5.1, MySQL 5.0 and MySQL 4.1.1.

Syntax:

DATE( expression )

Parameters: expression: It is used to specify the date or datetime value.

Example 1:

mysql> SELECT DATE ('2019-07-05');

Output:

'2019-07-05'

Explanation: The date value has been extracted from the datetime value.

Example 2:

mysql> SELECT DATE ('2019-07-05 15:30:20');

Output:

'2019-07-05'

Explanation: The date value has been extracted from the datetime value.

Please follow and like us:
Content Protection by DMCA.com