Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
DECLARE @T TABLE (CustID INT, Date DATETIME, Amount MONEY)
INSERT @T
SELECT 1, CURRENT_TIMESTAMP - 10, $1.00
UNION ALL SELECT 1, CURRENT_TIMESTAMP - 10, $2.00
UNION ALL SELECT 1, CURRENT_TIMESTAMP - 30, $5.00
UNION ALL SELECT 1, CURRENT_TIMESTAMP - 29, $9.00
UNION ALL SELECT 1, CURRENT_TIMESTAMP - 50, $5.00
UNION ALL SELECT 1, CURRENT_TIMESTAMP - 49, $99.00
UNION ALL SELECT 1, CURRENT_TIMESTAMP - 100, $123.00
UNION ALL SELECT 1, CURRENT_TIMESTAMP - 99, $-5.00
UNION ALL SELECT 1, CURRENT_TIMESTAMP - 400, $13.00
UNION ALL SELECT 1, CURRENT_TIMESTAMP - 400, $13.00
SELECT
CustID,
DATEPART(YEAR,Date),
DATEPART(WEEK, Date),
SUM(Amount)
FROM
@T
GROUP BY
CustID,
DATEPART(YEAR,Date),
DATEPART(WEEK, Date)