MySQL Forums
Forum List  »  General

Re: date comparison
Posted by: Bob Field
Date: January 22, 2007 01:52PM

Try like this:
SELECT *
FROM tab1 
WHERE tab1.col1 BETWEEN '2006-12-25' AND '2006-12-31';
The problem with your use of DATE_FORMAT is you have formatted the date so it does not collate in date order. The MySQL default format of YYYY-MM-DD does.

Options: ReplyQuote


Subject
Written By
Posted
January 22, 2007 01:31PM
Re: date comparison
January 22, 2007 01:52PM


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.