Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Divide number of records in equal parts

$
0
0
Hello,

I have a table with a list of records (names) that I would like to divide equally by a number of users. The number of users can change from time to time.
Data in the table is imported via a text file and I need to sort and divide the records based on the Last Name field which is a text field. Division is required to set up a workload distribution list.

I have already creted a form with texboxes which calculate the total number of records in my table and how many records each user should be assigned (total number/number of users = Number of records each user is assigned).
My problem is that once I get the number of records each user should work. I probably need to create a query or write up a code that will show the first and last records (the last name) which I need to assign.

Examples:

Total Number of records: 6
User: 3
Records assigned to each user: 2

Records in table by last Name

BLACK
BLUE
GREEN
PINK
RED
WHITE

User 1 should be assigned 2 records, I need a query that returnes returns 2 records, and diplays BLACK and BLU ( I would like to show these in a textbox on a form)
User 2 should be assigned the next two records GREEN and PINK
User 3 should be assigned the next two recors RED and WHITE

My table does not have an autonumber as field. Honestly I do not know how to preceed.

I was thinking of creating some sort of query but just do not know how to proceede. I you wish I can attaching an example file it this can help.
Thank you for your help.

Attached Files
File Type: zip tes.zip (29.7 KB)

Viewing all articles
Browse latest Browse all 13329

Trending Articles