I am having a probably simple to solve problem I want to make a query in MySQL that will return the soon to be released games based on games with released dates after today. Here is the query so far SELECT `title`, `releasedate` FROM `site_games` WHERE str_to_date(`releasedate`, "%M %e, %Y") >= CURDATE() ORDER BY `releasedate` Code (markup): The problem is that is sorts it a little wierd Ski-Doo Snowmobile Challenge February 24, 2009 The Godfather II February 24, 2009 Killzone 2 February 27, 2009 Resident Evil 5 March 13, 2009 WWE Legends of WrestleMania March 17, 2009 The Wheelman March 20, 2009 Command & Conquer: Red Alert 3 March 23, 2009 Wanted: Weapons of Fate March 24, 2009 Monsters vs. Aliens March 29, 2009 Guitar Hero: Metallica March 29, 2009 Major League Baseball 2K9 March 3, 2009 MLB 09 The Show March 3, 2009 Eat Lead: The Return of Matt Hazard March 3, 2009 Watchmen: The End is Nigh March 5, 2009 Tom Clancy’s H.A.W.X March 6, 2009 Code (markup): As you see, March 29 is before March 3. This would be wrong. I would I make it sort so it would list it right?
Or you might think that releasedate is like a date or something so why not make it a date field, call me stupid but that way the database server gets to worry about date and stuff , then any Date manipulation functions can be used and sorting works without unnecesary conversions.