By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,491 Members | 858 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,491 IT Pros & Developers. It's quick & easy.

Advice On Random Sample

P: n/a
Hello everyone,

I had a query that took 3,000 random records (which are addresses)from
a table.

This recordset is to send off surveys. I've noticed by looking at the
data, that I have some people who live at the same address. For
instance Bob Smith and Betty Smith. They both live at 120 Elm Street
in Albany New York.

I've also noticed that sometimes you have Bob Smith who lives at 120
Elm Street in Albany New York and then another Bob Smith who lives at
10 Pine Grove in Albany New York.

Because this is a random sample and I dont want to survey the same
person twice, I figure I step through the recordset, find a person with
the same first and last name. Then check if they live in the same
city. If they do, delete the second record.

Can someone give me an idea on code? Also, is there a better way of
doing this? DISTINCT wont work because of the first name (same
address, last name) being different.

Thanks,
Brian

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Brian,

You first need to purge your people table of duplicates. Then you need a
PersonID primary key that is autonumber. Finally, in your random generator
you need a way to prevent picking any PersonID more than once.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"BerkshireGuy" <bd*****@yahoo.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
Hello everyone,

I had a query that took 3,000 random records (which are addresses)from
a table.

This recordset is to send off surveys. I've noticed by looking at the
data, that I have some people who live at the same address. For
instance Bob Smith and Betty Smith. They both live at 120 Elm Street
in Albany New York.

I've also noticed that sometimes you have Bob Smith who lives at 120
Elm Street in Albany New York and then another Bob Smith who lives at
10 Pine Grove in Albany New York.

Because this is a random sample and I dont want to survey the same
person twice, I figure I step through the recordset, find a person with
the same first and last name. Then check if they live in the same
city. If they do, delete the second record.

Can someone give me an idea on code? Also, is there a better way of
doing this? DISTINCT wont work because of the first name (same
address, last name) being different.

Thanks,
Brian

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.