M
Mark.M.Sweeney
I have a table with about 31000 records. Table as the following
fields:
Invoice Number,
Supervisor,
Employee,
Action
The action only has 3 possible variables - buy, sell, hold.
I want to check the quality of the employees work an so I want to
somehow query and randomly select:
10 buy, 10 sell and 5 hold for each employee, by supervisor.
I've tried the below, but it is way too limiting as I'm looking for a
result of a lot of files, not just 10:
SELECT TOP 5 INVOICE_NUMBER, SUPERVISOR, EMPLOYEE, ACTION
FROM EMPLOYEE_STATS
WHERE (((ACTION)=[Action - BUY, SELL, HOLD?]))
ORDER BY SUPERVISOR, EMPLOYEE, ACTION;
In the above, I put in the WHERE clause so that I can get 10 per
action. Ideally, I wouldn't have that because I want 10, 10 and 5 as
stated above for each employee.
Any help is hugely appreciated!
Mark
fields:
Invoice Number,
Supervisor,
Employee,
Action
The action only has 3 possible variables - buy, sell, hold.
I want to check the quality of the employees work an so I want to
somehow query and randomly select:
10 buy, 10 sell and 5 hold for each employee, by supervisor.
I've tried the below, but it is way too limiting as I'm looking for a
result of a lot of files, not just 10:
SELECT TOP 5 INVOICE_NUMBER, SUPERVISOR, EMPLOYEE, ACTION
FROM EMPLOYEE_STATS
WHERE (((ACTION)=[Action - BUY, SELL, HOLD?]))
ORDER BY SUPERVISOR, EMPLOYEE, ACTION;
In the above, I put in the WHERE clause so that I can get 10 per
action. Ideally, I wouldn't have that because I want 10, 10 and 5 as
stated above for each employee.
Any help is hugely appreciated!
Mark