Reputation: 1
I have a table where a column is "Week", and I want to select all the rows of the table where "Week" is the current week and also the week before.
For instance, today is 15/02/2017 so, it is week 7. I want to select all the rows where "Week" Between 6 and 7 , but without writting the numbers, so it will change with the current week.
Thank you very much.
Upvotes: 0
Views: 44
Reputation: 683
Try this.
SELECT * FROM TBL
WHERE [WEEK_COLUMN] BETWEEEN WEEK(CURDATE())-1 AND WEEK(CURDATE())
Upvotes: 3