filter out randomly?

S

sally t

Can I ask Access to filter out say, 100, randomly chosen records from a large
list? ie no criteria but just specify the number of random records I want?

Thanks
Sally T

PS If not - does anyone know how to do this in Excel?
 
M

Marshall Barton

sally said:
Can I ask Access to filter out say, 100, randomly chosen records from a large
list? ie no criteria but just specify the number of random records I want?


SELECT TOP 100 keyfield, posfield, fieldA, . . .
FROM table
ORDER BY Rnd(posfield)

Don't forget to use the Randomize statement somewhere before
running the query.

The field name used in the Rnd function can be any field
that contains only positive numbers, no zeros, no negatives
and no Nulls.
 
S

sally t

many thanks!

sally

Marshall Barton said:
SELECT TOP 100 keyfield, posfield, fieldA, . . .
FROM table
ORDER BY Rnd(posfield)

Don't forget to use the Randomize statement somewhere before
running the query.

The field name used in the Rnd function can be any field
that contains only positive numbers, no zeros, no negatives
and no Nulls.
 
K

KARL DEWEY

Excel can by adding another column and filling with number generated using
the random function. Soet on the random number column and then select the
first 100.
 
Top