DATE()
DATE(expression)This function returns the date from a given string, value, or expression that is submitted in a date or datetime format. This function is available as of version 4.1.1 of MySQL. Here is an example:
SELECT appointment, DATE(appointment) FROM appointments WHERE client_id = '8639' LIMIT 1; +---------------------+-------------------+ | appointment | DATE(appointment) | +---------------------+-------------------+ | 2008-01-11 14:11:43 | 2008-01-11 | +---------------------+-------------------+
In this SQL statement, the value of the
appointment column, which is a
DATETIME type column, is shown first. The second
field is the date extracted by the function from the same column and
row.