i have a database with a Row named date and a type of Timestamp. Now i have a problem with only viewing content where it is added in the current week. So that you don't see content of last week. How can i do this in a query?, btw i am using MySQL
Asked
Active
Viewed 32 times
-2
-
Which dbms are you using? (Such functionality is too often product specific.) – jarlh Oct 12 '16 at 10:38
-
Sorry, added it – Nordy Vlasman Oct 12 '16 at 10:47
1 Answers
0
Assuming you're happy with MySQL's definition of week:
where('WEEKOFYEAR(DATE(`date`)) = WEEKOFYEAR(NOW())');

Neville Kuyt
- 29,247
- 1
- 37
- 52