setting parameters for numbers in a column

T

Tammy

I need to have a column that only numbers 1-20, with a repeat numerical
system of 1 - 20 for a database of 200. The project: breaking down 200
employees into groups of 10 so I need to number them 1-20 since we'll have 20
groups. I wasn't finding the solution in the help section.
 
K

KARL DEWEY

Try this --
SELECT Q.EmpID, Q.Employee, (((SELECT Count(*) FROM [tblEmployee] [XX]
WHERE [XX].[EmpID] < Q.[EmpID])+1)\10)+1 AS My_Group
FROM tblEmployee Q
ORDER BY Q.[EmpID];
 

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