MySQL Forums
Forum List  »  General

MySQL Date Query issue
Posted by: London Romeo
Date: March 26, 2009 07:24AM

Hi

I have questions regarding MySQL date.

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-mm-dd

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?



Edited 1 time(s). Last edit at 03/26/2009 07:25AM by London Romeo.

Options: ReplyQuote


Subject
Written By
Posted
MySQL Date Query issue
March 26, 2009 07:24AM
March 27, 2009 09:48AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.