Query to convert from datetime to date mysql

Solution 1:

Try to cast it as a DATE

SELECT CAST(orders.date_purchased AS DATE) AS DATE_PURCHASED

Solution 2:

Use the DATE function:

SELECT DATE(orders.date_purchased) AS date

Solution 3:

I see the many types of uses, but I find this layout more useful as a reference tool:

SELECT DATE_FORMAT('2004-01-20' ,'%Y-%m-01');

enter image description here