select date sql (only show results within this week)
Posted on 2004-09-28
I am trying to select all the records to display that are only within the current week
This is my SQL
SELECT date, projectnumber, fullname, hoursworked , code, description
INNER JOIN projects
ON userData.projectnumber = projects.number
where fullname ='Bob Smith'
AND DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= date
ORDER BY date ASC
the DATE_SUB(CURDATE(),INTERVAL 7 DAY) <= date
part does not return the correct data
I only want to show the records between
2004-09-26 AND 2004-10-02
(the current work week)
Then on Sunday of next week I only want to show the records for that week
2004-10-03 to 2004-10-09
and so on each week there after.
What do I need to change to get only the records to show for the current week?