Reputation: 27
$query = "SELECT asset_id FROM #__content WHERE state = 1 AND YEARWEEK(publish_up) = YEARWEEK(NOW())";
using this string I can get all articles created in a week, but the broblem is, it counts from monday to sunday and I need it to be plain 7 days in a row regardless.
Upvotes: 0
Views: 46
Reputation: 2602
Not sure whether this is what you asked for.
SELECT asset_id FROM #__content WHERE state = 1 AND DATE(publish_up) >= DATE_SUB(CURRENT_DATE, INTERVAL 7 DAY)
Upvotes: 1