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
Solved

Find subtle differences

Posted on 2014-02-11
3
237 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
3 Comments
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 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 65

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

838 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