filter out randomly?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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.
 
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.
 
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.
 
Back
Top