I have questions regarding MySQL date and querying with it.
First:
SELECT * FROM post WHERE DATE(Post_Date)="2009-03-25"
returns 0 results
SELECT * FROM post WHERE Post_Date="2009-03-25"
returns 71 results
SELECT * FROM post WHERE Post_Date>="2009-03-25"
returns 379 results
I understand that the second query returning 71 results match only posts with 2009-03-25 00:00:00
as the Post_Date
and the third query shows everything. BUT why does the first query SHOW 0 RESULTS?? Please help! I checked the MySQL cnf and the date_format
is set to %Y-%m-%d
Second:
SELECT * FROM post WHERE DATE(Post_Date)="2009-03-25"
RETURNS results on WINDOWS!
SELECT * FROM post WHERE DATE(Post_Date)="2009-03-25"
NO RESULTS in Linux!
Any pointers will be helpful! Is there a configuration file that I need to change to make this work in Linux?