Random Selection of Records

G

Guest

Hi

I have a need to generate a report showing a 10% Random selection of
records. There will be an initial criteria of a date, then I need to have a
random selection of 10% of the selected records displayed on the form.
Is the 10% part achievable and the random part also achievable, if they are
how would I go about this.


many Thanks

Richard
 
G

Guest

SELECT TOP 10 PERCENT asa.*
FROM asa
WHERE randomizer()=0
ORDER BY Rnd(IsNull([asa].[AsaID])*0+1);

Put in the proper table name for "asa".
For AsaID put in a field name for an Autonumber field.
 
G

Guest

Hi Jerry
The randomizer() function need to be defined

Look at this link:

http://www.mvps.org/access/queries/qry0011.htm

--
Good Luck
BS"D


Jerry Whittle said:
SELECT TOP 10 PERCENT asa.*
FROM asa
WHERE randomizer()=0
ORDER BY Rnd(IsNull([asa].[AsaID])*0+1);

Put in the proper table name for "asa".
For AsaID put in a field name for an Autonumber field.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


richard said:
Hi

I have a need to generate a report showing a 10% Random selection of
records. There will be an initial criteria of a date, then I need to have a
random selection of 10% of the selected records displayed on the form.
Is the 10% part achievable and the random part also achievable, if they are
how would I go about this.

many Thanks

Richard
 
G

Guest

Doh! Thanks for keeping me straight!
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

Ofer Cohen said:
Hi Jerry
The randomizer() function need to be defined

Look at this link:

http://www.mvps.org/access/queries/qry0011.htm

--
Good Luck
BS"D


Jerry Whittle said:
SELECT TOP 10 PERCENT asa.*
FROM asa
WHERE randomizer()=0
ORDER BY Rnd(IsNull([asa].[AsaID])*0+1);

Put in the proper table name for "asa".
For AsaID put in a field name for an Autonumber field.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


richard said:
Hi

I have a need to generate a report showing a 10% Random selection of
records. There will be an initial criteria of a date, then I need to have a
random selection of 10% of the selected records displayed on the form.
Is the 10% part achievable and the random part also achievable, if they are
how would I go about this.

many Thanks

Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top