Results 1 to 2 of 2

Thread: Date Query Problem

  1. #1
    Join Date
    Oct 2005
    Posts
    13

    Date Query Problem

    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

  2. #2
    Join Date
    Dec 2005
    Location
    Cape Town, South Africa
    Posts
    21
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •