Group Every 12th record

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
 
K

KARL DEWEY

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;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top