Agregar Fecha de finalización de la semana SQL Server
SELECT
DATEADD(DAY, 7 - DATEPART(WEEKDAY, orderDate), CAST(orderDate AS DATE)) AS ordersPerWeek,
sum(orderAmount) AS orderSumForGrouping,
count(1) AS numberOfOrdersWithinGrouping
FROM @table o
GROUP BY DATEADD(DAY, 7 - DATEPART(WEEKDAY, orderDate), CAST(orderDate AS DATE))
Stupid Serval