I'd do it with 3 queries, one for each type, then if necessary to combine
them, use a union query. So:
Create a function in a module:
Function GetRandNum(varValue As Variant) As Double
GetRandNum = Rnd(1)
The query would look like:
SELECT TOP 10 ID, [Name], [Date], Type
WHERE Type = "A" ' or B or C
ORDER BY GetRandNum(ID);
Also, note that Name and Date are reserved words and you will have big
problems using them, which is why I used square brackets around them.
Now the Union query looks like:
Select * From Query A
Select * From Query B
Select * From Query C;
Arvin Meyer, MCP, MVP
"Paul" hotmail.com> wrote in message
> Hello. I have a table in Access that is updated each day with data
> from the previous business day. The table consists of a date, name,
> type and id. For this example, let's say that the types are Type A,
> Type B or Type C. I need to take a random sampling of 10 id's for
> each of the different Types for each Name that is listed for a
> particular day. For example if 1 agent worked yesterday, I would
> need to see a random sampling of 10 Type A id's, 10 Type B id's and 10
> Type C id's for a grand total of 30. If more agents worked then I
> would need to have the same for each of them.
> Does this make sense? 10 random id numbers of each type for each
> agent that worked on a particular day. Does anyone have any thoughts
> on this?
> Any help would be greatly appreciated.