SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2000
    Location
    Norcross, GA
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    WHERE TO_DAYS(eventdate) > TO_DAYS(NOW())

    This is what I currently have. Works great. Now I'd like to narrow the focus to show only future eventdates that occur in the next 60 days.

    Just fooling around I tried:
    WHERE TO_DAYS(eventdate) > TO_DAYS(NOW()) +60

    That returned everything in the future starting 60 days from NOW().

    Looked at the MySQL documentation (http://www.mysql.com/doc/D/a/Date_an...functions.html) and there wasn't an example to demostrate this concept, so I'm not even sure it can be done.

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is possible:

    Code:
    SELECT * from tablename WHERE DATE_ADD(NOW(), INTERVAL 60 day) > eventdate AND eventdate > NOW();
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

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