473,398 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Advice On Random Sample

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
1 2312
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Bart Nessux | last post by:
New to Python... trying to figure out how to count the objects in a list and then map the count to the objects or convert the list to a dict... I think the latter would be better as I need a number...
9
by: Bart Nessux | last post by:
I am using method 'a' below to pick 25 names from a pool of 225. A co-worker is using method 'b' by running it 25 times and throwing out the winning name (names are associated with numbers) after...
21
by: Andreas Lobinger | last post by:
Aloha, i wanted to ask another problem, but as i started to build an example... How to generate (memory and time)-efficient a string containing random characters? I have never worked with...
4
by: james blair | last post by:
Hi I am generating a random number using random.randint(1,10000000000) Whats the possibility that the numbers generated will be same when generated by 100 users at the same time? Whats the best...
2
by: Tim Mackey | last post by:
hi folks, i'm puzzled over this one, anyone with some solid db experience might be able to enlighten me here. i'm modelling a file system in a database as follows, and i can't figure out to...
1
by: steflhermitte | last post by:
Dear cpp-ians, I want to apply a stratified sampling on an image. Following simplified example will explain my problem. The original image I with nrows and ncols is now a vector V of length...
4
by: Jesse Noller | last post by:
Hello - I'm probably missing something here, but I have a problem where I am populating a list of lists like this: list1 = list2 = list3 = main_list =
5
by: jordi | last post by:
I need the random.sample functionality where the population grows up to long int items. Do you know how could I get this same functionality in another way? thanks in advance. Jordi
232
by: robert maas, see http://tinyurl.com/uh3t | last post by:
I'm working on examples of programming in several languages, all (except PHP) running under CGI so that I can show both the source files and the actually running of the examples online. The first...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.