How can I display 20 random records per OperatorID

Liz_I3

Well-known Member
Joined
Dec 30, 2002
Messages
647
Office Version
  1. 2016
Platform
  1. Windows
Hi
I am working in Access 2010
I want to create a query that will extract 20 random records from a table per OperatorID.
I am using the rnd function with the Abs and have set the number of records returned in the query properties to 20. But all I am getting is 20 random records not 20 per operatorID. I did not want to group the records just display 20 rows per operator that had data that day. What am I missing

Thanks
L
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Methinks you will have to create a query that gets a recordset of operators that meet your criteria, then base the aggregate query you have on that. Equal join between OperatorID in first query to OperatorID in second should do it.
 
Upvote 0
I am still only able to get the 20 records. I need to get 20 difference records for each operator ID. There are approx. 11 operators at present but this could vary.

Any Ideas are appreciated
Thanks
L
 
Upvote 0
You will have to provide some clues - we know nothing of your table/field inputs or what you have for a query so far. I suggest you create some fake data in Excel, complete with table name in A1, then field names as colum headers in row 2, then data. Keep the column sizes small as possible. You can create a range for each table as required, then copy and dump into your next post. Include your sql as well.
 
Upvote 0

Forum statistics

Threads
1,221,832
Messages
6,162,254
Members
451,757
Latest member
iours

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top