noob
noob

Reputation: 300

MySQL SELECTING DATES

I am querying some data from MySQL table, one of the column has a datatype DATETIME. Now when I do query, it includes an annoying 00:00:00 time. How can I exclude this time part when doing a select?

Upvotes: 0

Views: 39

Answers (1)

John Woo
John Woo

Reputation: 263883

use DATE

SELECT DATE(columnName)
FROM....

or DATE_FORMAT

SELECT DATE_FORMAT(NOW(),'%Y-%m-%d');

Upvotes: 2

Related Questions