setting parameters for numbers in a column

  • Thread starter Thread starter Tammy
  • Start date Start date
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.
 
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];
 
Back
Top