Samples Query

N

Neily

Hi,

I was wondering if there is any way of writing queries in Access to bring
back a sample or even better a random sample from certain groupings of data.
For example, Each Date may have several Sales transactions and you want to
get 5 samples from each day over the course of a week.

Any ideas anyone?

Ta.

Neil
 
M

Marshall Barton

Neily said:
I was wondering if there is any way of writing queries in Access to bring
back a sample or even better a random sample from certain groupings of data.
For example, Each Date may have several Sales transactions and you want to
get 5 samples from each day over the course of a week.


Don't know how useful that is, but you can add the TOP
oredicate to your query whit a random sorting:

SELECT TOP 5 *
FROM . . .
WHERE . . .
ORDER BY Rnd([somefield])
 
Top