"random" vs. "representative"

R

RD

I'm often asked to create reports containing a "random" selection of
records. I've got several different functions for doing this
depending on the report requirements.

What I'm finding out is that when people say they want a "random"
sample they really mean "I want a representative sample but I don't
want to choose the records myself".

I have a "type" field and a "subtype" field. There would be types
01-99 and subtypes 0-9 and A-Z combined appearing like: 30-C or 04-1
etc.

The request was for "a random sample of 100 records but make sure
there are plenty of 45-* records".

Anybody have any ideas on returning "representative" records?

Thanks for any help,
RD
 
R

RD

Fuhgeddaboudit. They've changed their minds.

I think, out of curiosity, I might take some time to develop a method
for pulling "representative" records. It might be useful for
statistical analysis.
 
D

Dizzyone

I saw in your question where you stated that you have several different
functions for selecting random records in a report. I have a table that has
an autonumber field. I need to retrieve every NTH record and I can't figure
out how to do this. I have created some macros and modules so I'm not a
complete Access/VBA novice. Any help you can give me will be greatly
appreciated.
 
P

PC Datasheet

Create a query based on your table. Add a calculated field that numbers your
records appropriately depending on what Nth is. Then pull out the records
where the number is evenly divided by N.


--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
(e-mail address removed)
www.pcdatasheet.com
 
D

dunk

Use Step to pull every Nth record.

From VB Help:

Using the Step keyword, you can increase or decrease the counter variable by
the value you specify. In the following example, the counter variable j is
incremented by 2 each time the loop repeats. When the loop is finished, total
is the sum of 2, 4, 6, 8, and 10.

Sub TwosTotal()
For j = 2 To 10 Step 2
total = total + j
Next j
MsgBox "The total is " & total
End Sub


HTH,
RD
 

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