Retrieve only the date portion.
| SELECT DATE(“2017-06-15”); |
The DATE() function isolates the date component from a datetime expression.
| DATE(expression) |
|
Parameter |
Description |
|
expression |
The DATE() function isolates the date component from a datetime expression. |
|
Works in: |
From MySQL version 4.0 |
Obtain the date component.
| SELECT DATE(“2017-06-15 09:34:21”); |
Isolate the date component (may return NULL).
| SELECT DATE(“The date is 2017-06-15”); |
Retrieve the date component.
| SELECT DATE(OrderDate) FROM Orders; |