• John Mitchell, I see that the solution works. It's nice. I understand CTE and 'PARTITION BY YEAR(OrderDate)' etc., but will you please explain why 'PARTITION BY 1'?

    --Quote me