I have the following query:
SELECT DATEPART(yyyy, ReferredOn) AS ReferredOnYear, SimpleName, SUM(Count) AS Count, Outcome
GROUP BY DATEPART(yyyy, ReferredOn), SimpleName, Outcome
HAVING (Outcome = N'Completed')
ORDER BY ReferredOnYear
This makes a nice summary of each SimpleName for each year. I would like to have a summary row for each year after its grouping. I'm not sure how to approach this. I tried a rollup but it didn't look as expected.