Help with returning records based on date using now() or curdate()
Hopefully this is a quick one, but I am getting some odd results trying to return records where a date field is between the current date and 7 days from the current date.
I have tried using:
WHERE trade_users.Follow_up_date >= (CURDATE() - INTERVAL 7 DAY)
or
WHERE trade_users.Follow_up_date >= NOW() - INTERVAL 7 DAY
Playing around with it, its doing something - I tried changing the range til I spotted it do something different.
So for example:
WHERE trade_users.Follow_up_date >= (CURDATE() - INTERVAL 70 DAY)
Returns records from 9 May 2017 to 12 November 2017, which is odd as it covers more than 70 days, with dates in both the past and the future.
If I just have WHERE trade_users.Follow_up_date >= NOW() it seems OK, ie returns the five records with a follow up date in the future.
Have attached the page below.
Thank you.