Solved

Find unmarched records based on multiple columns

Posted on 2014-09-06
5
235 Views
Last Modified: 2014-09-07
I have a staging table and a permanent table.  I need to determine if there are unmatched records in the staging table.  I tried using ACCESS 2010 query wizard, but that did not work.  I tried modifying the query, but that did not work.  So, how to I check two tables for unmatched records based on the corresponding 10 columns between them?
0
Comment
Question by:ssmith94015
[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
  • 2
5 Comments
 
LVL 29

Accepted Solution

by:
sammySeltzer earned 500 total points
ID: 40307992
In other words, you want to find out what records exists in permanent table but not in staging table?

If my assumption is correct, then try this:

SELECT *
FROM   PermanentTable
WHERE  NOT EXISTS
  (SELECT *
   FROM   StagingTable
   WHERE  StagingTable.ID= PermanentTable.ID)

Open in new window

0
 

Author Comment

by:ssmith94015
ID: 40308067
the problem is I need to match ten columns, not one.
0
 
LVL 29

Expert Comment

by:sammySeltzer
ID: 40308106
Did you run this code?

What makes you think it is for just one column?
0
 

Author Comment

by:ssmith94015
ID: 40308168
Well, there is no unique identifier and the users can enter multiple records that are virtually the same except for small differences the different fields.  The 10 columns have to be compared as a unit for uniqueness.  I did not create this database but have to work with what the client already has.  I have been doing this for quite a few years, but with databases I created and ensured one identity column and while I have solved this  before, with my time constraints I was hoping for a quick resolution so I do not have to dig through my code library.  I am trying to get about three weeks work done in the next two days and was just hoping for a canned solution.
0
 

Author Closing Comment

by:ssmith94015
ID: 40308606
I got a little sleep and took a look again.  This will work, thank you.  It has helped tremendously in finishing atT least one aspect of this mess.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

734 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