?
Solved

Find subtle differences

Posted on 2014-02-11
3
Medium Priority
?
241 Views
Last Modified: 2014-02-11
Two Tables to compare:  "Old Data" and "New Data"
I need to query and find any difference at all in the following fields:
Full Name, Grade, Abbreviation, Home, TechID.

Key field is "Full Name"

Is there a single query that will show me any difference in any of those fields?

I would like to show the results from table "New Data", the old doesn't matter.
0
Comment
Question by:TIgerV
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 2000 total points
ID: 39850079
try this query

SELECT [New Data].[Full name], [New Data].Grade, [New Data].Abbreviation, [New Data].Home, [New Data].TechID
FROM [New Data] LEFT JOIN [Old Data] ON ([New Data].TechID = [Old Data].TechID) AND ([New Data].[Full name] = [Old Data].[Full name]) AND ([New Data].Grade = [Old Data].Grade) AND ([New Data].Abbreviation = [Old Data].Abbreviation) AND ([New Data].Home = [Old Data].Home)
WHERE ((([Old Data].[Full name]) Is Null) AND (([Old Data].Grade) Is Null) AND (([Old Data].Abbreviation) Is Null) AND (([Old Data].Home) Is Null) AND (([Old Data].TechID) Is Null));


or use the query wizard > Find Unmatched query wizard
0
 
LVL 66

Expert Comment

by:Jim Horn
ID: 39850083
>Key field is "Full Name"
Bad choice, as there can be more than one person with the same name, i.e. John Smith, Jane Doe, Paddy O'Flavo, and in those cases the name is not unique.

>I need to query and find any difference ... Full Name
>Key field is "Full Name"
You can have one or the other, but not both, as SQL needs to know how to join these two tables, and if you're using Full Name then it looks for rows where the two values are the same, and has no way of knowing if different rows are a legitimate difference (Jim Horn vs. James Horn), or a difference to ignor (Danny Wareham vs. Miriam Bizup).

>Is there a single query that will show me any difference in any of those fields?
Something like..

SELECT n.[Full Name], n.Grade, n.Abbreviation, n.Home, n.TechID
FROM [New Data] n
   INNER JOIN [Old Data] o ON n.[Full Name] = o.[Full Name]
WHERE n.Grade <> o.Grade OR
   n.Abbreviation <> o.Abbreviation OR
   n.Home <> o.Home OR
   n.TechID <> o.TechID
0
 

Author Closing Comment

by:TIgerV
ID: 39850121
Find unmatched was only giving me one column's difference.  However the SQL code above worked fine.
0

Featured Post

10 Questions to Ask when Buying Backup Software

Choosing the right backup solution for your organization can be a daunting task. To make the selection process easier, ask solution providers these 10 key questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question