MySQL Forums
Forum List  »  General

Re: Date Strings in database
Posted by: KimSeong Loh
Date: November 16, 2004 12:55AM

With this DATE_FORMAT(Date,'%m-%d-%y') > 11-15 -04
you are doing either a numeric or string comparison, I do not know which, though. It is definitely NOT a date comparison anymore.

DATE_FORMAT() will give you a string and 11-15 -04 will give you a number of 11-15 -04 = -8.
I suspect it will be a numeric comparison since you mentioned all rows are returned.

If you want to do a DATE comparison, you should have keep the left-hand-side as Date and try to convert your 11-15 -04 into 'YYYY-MM-DD' format.

Options: ReplyQuote


Subject
Written By
Posted
November 15, 2004 10:09AM
Re: Date Strings in database
November 16, 2004 12:55AM


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.