logo

Highly experienced and skilled on Software Architecture (PHP, MySQL, JavaScript, jQuery, Ajax, XML, API Services), Server and Software Security, Project Management combined with Online Marketing & Internet Advertising background. I am a "Problem Solver" who only focuses on "Results". Leaded/worked on 500+ Web/Software/Marketing Projects about Web, E-Commerce, ERP, CRM, CMS, B2B, B2C, XML, API, Online Flight & Hotel Reservation Systems almost from every industry until today.

Contact Info

info@halukyamaner.com

Dubai / United Arab Emirates

Select "Date" from "Datetime" Column in MySQL

If you would like to select only "date" from "datetime" column, you can use DATE() function of MySQL, inside the query with an easy way.

Example:

"Date" column is storing values as "datetime" format like: 2020-01-01 00:00:00

This way you can not directly match values if you are trying to fetch records with "2020-01-01" dates because of time values are conflicting exact match.

Query:

There are a few more alternative to select without time value, but I think this one is the easiest.

DATE() function of MySQL in WHERE condition:

Example Usage:

SELECT * FROM 'TableName' WHERE DATE('ColumnName') = DATE('2020-01-01');

Share this post:

Contact Form

Share about your ideas or projects, just fill form below and I'll get back to you asap.

Type security code on the box for verification.