Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2005

    Unanswered: selecting a date range

    I am sure this question has been posted here before, but a search has proven inconclusive.

    I am hoping for some help.

    I am building an event calander. I wish to show the up-coming week of events on my splash page. I have a table that is a date formatted row, 2005-03-07.

    I would like to select everything from today up-to 7 days from today in a single querry. I have tried a few things out without the results that I am looking for, most querries i have tried do not discriminate between yesterday and tomarrow.
    query = "SELECT * FROM tblEvents WHERE tblEvents.`date` <= CURDATE()+7";

    HELP!!!!A date range query will save my life!!!!

  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
     where tblEvents.`date` 
           >= current_date
       and tblEvents.`date` 
           < date_add(current_date, interval 7 day) | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2005


    This is slightly different than all the various versions of this query I have tested out, I knew I was getting twisted with it... I will try this out...THANKS!

Posting Permissions

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