473,397 Members | 1,949 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,397 software developers and data experts.

Validating Multiple Records in Same Table

Good evening all, I have a problem that I've been banging my head against for a few hours and was looking for some advice. Consider a table with the following data:

SSN (int)
first_name (char)
last_name (char)
middle_name (char)

A sampling of data would appear as such:
000112222, Jones, Jeff, J.
000112222, Jones, Jeff, Jason
111223333, Wright, Kevin, ''
222333444, Jones, Jeff, J.

Knowing that a unique person may have an entry for the same SSN due to variations in the name, I need to find out if there are any instances where the best match of a person's name might be on more than one distinct SSN. In the above example, Jeff Jones appears on one SSN twice due to one record having his middle name spelled out. This is not an issue. However, Jeff Jones also appears on a completely different SSN. This is the discrepancy I need to look for.

Now, I have in the past compared names on the same SSN by using DIFFERENCE() and/or SOUNDEX() to score possible data anomalies, but I'm sort of stuck on checking the names across multiple SSN's to find when a unique person (based on names) have more than one SSN record.
Jan 10 '09 #1
2 2042
Jibran
30
Try using a cursor and go over each table record one at a time selecting the name fields. In the body of the cursor, write a query to retrieve SSN for the selected record if the count(..) >1 or something.
Jan 11 '09 #2
Delerna
1,134 Expert 1GB
Presuming that the last name is always present in full
and at least the first letter of the first name
and at least the first letter of the middle name
is always present

Then something like this should work for you
Expand|Select|Wrap|Line Numbers
  1. select *
  2. from TheTable a
  3. join TheTable b on a.Last_Name=b.Last_Name
  4.                      and left(a.first_name,1)=left(b.first_name,1)
  5.                      and left(a.middle_name,1)=left(b.middle_name,1)
  6.                      and a.ssn<>b.ssn
  7.  
Jan 12 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
6
by: Christopher Harrison | last post by:
Is there a way to store an indefinite number of keys in one field and self join them? Imagine, for example, you have a table of users with a "friends" column. Say user 1 is friends with users 9, 7,...
11
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access and I'm not looking for someones help to design my...
6
by: James Radke | last post by:
Hello, I have a multithreaded windows NT service application (vb.net 2003) that I am working on (my first one), which reads a message queue and creates multiple threads to perform the processing...
12
by: shank | last post by:
I'm trying to use online samples for submitting multiple records from ASP into a stored procedure. Failing! Through the below form, a user could be submitting many records at a time. I'm not...
8
by: Martin | last post by:
I hope not, but, I think the answer to this question is "it can't be done". Northwind sample database. Orders form. Go to a new record. Select a customer in "Bill To:" Don't enter any...
6
by: ApexData | last post by:
I have 2 tables: Table1 and Table2. Neither one has a primary key because each table will only have 1-record. My form is a SingleForm unbound with tabs (my desire here). Using this form, in...
11
by: shriil | last post by:
Hi I have this database that calculates and stores the incentive amount earned by employees of a particular department. Each record is entered by entering the Date, Shift (morn, eve, or night)...
6
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.