Problem with date query

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jack Lauman

    #1

    Problem with date query

    I have a table with a column "date" that contains dates in SQL format,
    i.e. 2003-08-10

    I need to query the table and return all the rows from the current date
    thru the next 6 days. (i.e. today 2003-08-10 thru Saturday 2003-08-16).

    I have tried the following query which returns all of the desired rows
    except those for the current date. How can I correct this?

    SELECT date, time, am_pm, tz, height, cond FROM cherry_point_ti des WHERE
    TO_DAYS(date) - TO_DAYS(NOW()) <= 6 and date > NOW();

    Thanks,

    Jack


    --
    MySQL General Mailing List
    For list archives: http://lists.mysql.com/mysql
    To unsubscribe: http://lists.mysql.com/mysql?unsub=m...ie.nctu.edu.tw

Working...