I need to match up an employee with a task in a small Microsoft Access DB I built. Essentially, I have a list of 45 potential tasks, and I have 25 employees. What I need is:
- Each employee to have at LEAST one task
- No employee to have more than TWO
- Be able to randomize the results every time I run the query (so the same people don't get consistently the same tasks)
My table structure is: Employees - w/ fields: ID, Name Tasks - w/ fields: ID, Location, Task Group, Task
I know this is a dumb question, but I truly am struggling. I have searched through SO and Google for help but have been unsuccessful.
I don't have a way to link together employees to tasks since each employee is capable of every task, so I was going to:
- SELECT * from Employees
- SELECT * from Tasks
- Union
- COUNT(Name) <= 2
But I don't know how to randomize those results so that folks are randomly matched up, with each person at least once and nobody more than twice.
Any help or guidance is appreciated. Thank you.
Aucun commentaire:
Enregistrer un commentaire