Group Every 12th record

  • Thread starter Thread starter Joe Schmoe
  • Start date Start date
J

Joe Schmoe

I want a running sum every 12th record, but I don't have a group for that
12th record. How do I group every 12th record for a running sum

Thanks
 
Try using a Ranking in a Group query with Integer division --

SELECT Q.Group, Q.Item_no, Q.Points, (((SELECT COUNT(*) FROM [Product] Q1
WHERE Q1.[Group] >= Q.[Group])+1)\12)+1 AS Rank
FROM Product AS Q
ORDER BY Q.Group, Q.Points;
 
Back
Top