I have an SQL pb. I need to group some bills by "sliding weeks" (my customer need 7 past days on the whole year, so starting on the current day) and I found nothing about it.. I'm quite sure I just don't have good keywords but still it's being 2days I'm searching.. So I have my sql request below which is working with normal WEEK use:
SELECT
WEEK(billing_date) as billed_week
, ROUND(sum(price) * 1.1, 2) as billed_amount
, billing_date as billing_date
FROM bills
JOIN missions m
ON bills.mission_id = m.id
WHERE customer_id = $customer_id
AND status = 2 AND YEAR(billing_date) = YEAR(CURRENT_DATE)
GROUP BY week(billing_date)
By example, is there anyway to update WEEK's function parameters?