Yes, use the date function:
SELECT date(my_date)
select date(somedate)
is the most common.
If you need to accommodate other formats, you can use:
SELECT DATE_FORMAT(your_date, '%Y-%m-%d');
In PostgreSQL you use the TRUNC() function, but I'm not seeing it for MySQL. From my brief Googling, it looks like you'll need to cast your DATETIME value to be just DATE.
date_col = CAST(NOW() AS DATE)
See http://dev.mysql.com/doc/refman/5.0/en/date-and-time-types.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With