I created the table yesterday and all should be selected however the query is returning only the rows added yesterday (20) but none from today.
This is my table structure:
Followed | Follower | Date (DATETIME)
This is the query:
SELECT * FROM Follows
WHERE Date BETWEEN DATE_SUB(CURDATE(), INTERVAL 7 DAY) AND CURDATE()
GROUP BY `Followed`
is there a way to select all rows post 7 days ago instead of limiting them to CURDATE()? What am I doing wrong?
You may want to cast the DATETIME attribute to a DATE to compare with the CURDATE():