473,411 Members | 2,019 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,411 software developers and data experts.

Looking for duplicate names

Looking for duplicat names is tough. How many Bob Smiths do you know?
Searching for a Concatenation of:
[lastname]&[firstname]&[address]&[phonenumber] with no spaces between fields
works pretty good but is not fool proof. Are M.I. always used? Is the input
spelling always correct? GIGO is a real problem with databases in general.

Chuck
Jan 15 '07 #1
5 1344
Chuck wrote:
Looking for duplicat names is tough. How many Bob Smiths do you know?
Searching for a Concatenation of:
[lastname]&[firstname]&[address]&[phonenumber] with no spaces between fields
works pretty good but is not fool proof. Are M.I. always used? Is the input
spelling always correct? GIGO is a real problem with databases in general.

Chuck
Indeed! If you can devise a way to unduplicate me in credit card
offerers' databases, I shall tip my hat with much veneration...

--
Smartin
Jan 17 '07 #2
"Chuck" <li*****@schoollink.netwrote
Looking for duplicat names is tough. How many Bob
Smiths do you know? Searching for a Concatenation of:
[lastname]&[firstname]&[address]&[phonenumber] with
no spaces between fields works pretty good but is not
fool proof. Are M.I. always used? Is the input
spelling always correct? GIGO is a real problem with
databases in general.
I agree with you and with Smartin. Did you have a question?

Larry
Jan 18 '07 #3
On Thu, 18 Jan 2007 03:48:27 GMT, "Larry Linson" <bo*****@localhost.notwrote:
>"Chuck" <li*****@schoollink.netwrote
Looking for duplicat names is tough. How many Bob
Smiths do you know? Searching for a Concatenation of:
[lastname]&[firstname]&[address]&[phonenumber] with
no spaces between fields works pretty good but is not
fool proof. Are M.I. always used? Is the input
spelling always correct? GIGO is a real problem with
databases in general.

I agree with you and with Smartin. Did you have a question?

Larry
Jan 18 '07 #4
On Thu, 18 Jan 2007 03:48:27 GMT, "Larry Linson" <bo*****@localhost.notwrote:
>"Chuck" <li*****@schoollink.netwrote
Looking for duplicat names is tough. How many Bob
Smiths do you know? Searching for a Concatenation of:
[lastname]&[firstname]&[address]&[phonenumber] with
no spaces between fields works pretty good but is not
fool proof. Are M.I. always used? Is the input
spelling always correct? GIGO is a real problem with
databases in general.

I agree with you and with Smartin. Did you have a question?

Larry
No, thank you, it was just a comment. Someone had asked how to look for
duplicate names but I had failed to save the original post. I was hoping
against hope that the original poster was reading this news group on a regular
basses and would see my post. I think now that my post was a bad idea, or at
least the subject description was badly stated.

Chuck
Jan 18 '07 #5
Chuck wrote:
it was just a comment.
Your comment gave me an idea. Maybe the following can avoid
concatenation issues:

qryDistinctList:
SELECT lastname, firstname, address, phonenumber FROM MyTable UNION
SELECT lastname, firstname, address, phonenumber FROM MyTable;

There's likely to be a simple way to remove duplicates using an
extension of this idea.

tblDuplicates
DID Autonumber
Field1 Text
Field2 Text
Field3 Text

DID Field1 Field2 Field3
1 A B D
2 A C D
3 A B D
4 B C E
5 A C E

qryDistinctList:
SELECT Field1, Field2, Field3 FROM tblDuplicates UNION SELECT Field1,
Field2, Field3 FROM tblDuplicates;

qryUnique:
SELECT First(DID) AS UID, tblDuplicates.Field1, tblDuplicates.Field2,
tblDuplicates.Field3 FROM tblDuplicates INNER JOIN qryDistinctList ON
(tblDuplicates.Field3 = qryDistinctList.Field3) AND
(tblDuplicates.Field2 = qryDistinctList.Field2) AND
(tblDuplicates.Field1 = qryDistinctList.Field1) GROUP BY
tblDuplicates.Field1, tblDuplicates.Field2, tblDuplicates.Field3 ORDER
BY First(DID);

!qryUnique:
UID Field1 Field2 Field3
1 A B D
2 A C D
4 B C E
5 A C E

What if only the combinations of Field1 and Field2 must be unique yet
Field3 must be shown?

qryDistinctList:
SELECT Field1, Field2 FROM tblDuplicates UNION SELECT Field1, Field2
FROM tblDuplicates;

!qryUnique:
SELECT First(DID) AS UID, tblDuplicates.Field1, tblDuplicates.Field2,
First(tblDuplicates.Field3) As FirstField3 FROM tblDuplicates INNER
JOIN qryDistinctList ON (tblDuplicates.Field2 = qryDistinctList.Field2)
AND (tblDuplicates.Field1 = qryDistinctList.Field1) GROUP BY
tblDuplicates.Field1, tblDuplicates.Field2 ORDER BY First(DID);

!qryUnique:
UID Field1 Field2 FirstOfField3
1 A B D
2 A C D
4 B C E

Since there are potentially many Field3 values for the unique
combinations of Field1 and Field2, a choice had to be made about which
one is to be returned. You can get fancy from here about which ones to
keep using subqueries (use the same criteria for both DID and Field3
noting that ordering by DID is not necessary in qryUnique). The most
recent dates or maximum values (price? :-)) are typical choices. An
unmatched query on DID and UID can identify which records to
delete/exclude. I hope these comments give you some ideas.

James A. Fortune
CD********@FortuneJames.com

Jan 18 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

44
by: Xah Lee | last post by:
here's a large exercise that uses what we built before. suppose you have tens of thousands of files in various directories. Some of these files are identical, but you don't know which ones are...
3
by: shine | last post by:
I am trying to add an integer array to a hashtable. While adding to hashtable I want to check the duplicates in array, the way I want to do is add the key(the integer stored in array) if a...
2
by: Pablo | last post by:
Hello, there, I have a table tblData which has pharmacy data. The table has following fields: ClaimNum, LineNum... The ClaimNum has claim number which is 12 characters. LineNum is NULL. The...
8
by: Iona | last post by:
Hi Allan, I'm using a nifty piece of code you put on here some time back to do a duplicate entry check as below. I'm using to check for duplicate names. However I am getting an error message on...
56
by: Omar | last post by:
I'd love the perfect editor that would be: a) free b) enable me to drag and drop code snippets from a sort of browser into the code c) can run programs right from within d) can edit
5
by: rob | last post by:
Does anyone know of a duplicate file checker project in C#? Couldn't locate anything on CodeProject or SourceForge. Has anyone here considered writing one?
4
by: whatnameisnottaken | last post by:
right now i have gotten all the classes to print out using helpdbg. Now i want to remove the duplicate class names out of an array so i can just print one of each. This is the output i have. ...
4
by: | last post by:
Given an XML file (dataset.writexml), here is my output (simplified for this posting): <?xml version="1.0" standalone="yes"?> <NewDataSet> <Category> <CategoryId>80</CategoryId>...
5
by: Brett Barry: Go Get Geek! | last post by:
Hello, Can someone please paste VBA code and how I would go about doing this?: I have a customer table with over 6000 duplicates in the field called "Customer". While the customer names may...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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.