PDA

View Full Version : Date Query Problem



binarytrends
24 Oct 2005, 08:01 AM
I have got date stored in MySQL in this format "Sat, 22 Oct 2005 - 19:30:00" and I want to write a query to select ALL records with DATE coming AFTER the CURRENT DATE or TODAY. In other words I want to select all future dates only. Can anyone help ?

http://www.binarytrends.com

spamfiend
09 Jan 2006, 07:12 PM
I've run into a similar problem before but was using Matlab to do all the scripting. So I can help with the procedure but cant give you actual php / mysql commands. Anyway,

You need to convert the date into some kind of number. There's almost always a way of doing this.... it basically counts the number of seconds that has passed between the date and time you specify and some arbitrary origin. Find out what that function's called and your problem is 90% solved.

Then you can do a normal conditional statement.