Solved

Find unmarched records based on multiple columns

Posted on 2014-09-06
5
233 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
  • 3
  • 2
5 Comments
 
LVL 28

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 28

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
A short article about problems I had with the new location API and permissions in Marshmallow
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

861 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