Hello, I’m relatively new user to Access and I’m running into a block regarding random sampling. I’m building a database for auditing purposes and I need to pull a random selection from 453 main cases,and each main case has 5 or more sub cases. I have to ensure I pull one sub case from each main case once per quarter.
I was able to build a query to run a random sample from the entire sample of sub cases, now I just need to be more specific. Here’s how my table & query are designed.
SQL:
SELECT TOP 8 cb_listing.ID, bc_listing.rom, cb_listing.region, cb_listing.[bc#], cb_listing.bcname, cb_listing.[cb#], cb_listing.desc, Rnd([ID]) AS RandomValue
FROM cb_listing INNER JOIN bc_listing ON cb_listing.[bc#]=bc_listing.[bc#]
ORDER BY Rnd([ID]);
Query:
ID
ROM (name of person)
Region
BC# (main case)
BCName
CB# (sub case)
Description
RandomValue: Rnd([ID])
I don’t know if this can be done but would appreciate any help you can bring!
Lauren