Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2014
    Posts
    35

    Unanswered: Data coming up in the next 5 days

    I have a table 'keydates' which, amongst others fields, has the field 'whendate'.

    I want to produce a query which will list all of the items in the table where the 'whendate' is between today and the next 5 days.

    I have tried to add the line:
    whendate BETWEEN DATE_SUB( CURDATE( ) ,INTERVAL 5 day ) AND DATE_SUB( CURDATE( ) ,INTERVAL 1 day )

    but this doesn't seem to get the correct results.

    Does anyone have any suggestions?

    Many thanks

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    Code:
    WHERE whendate BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 5 DAY)
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Feb 2014
    Posts
    35
    That's great. Many 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
  •