Solved

Find unmarched records based on multiple columns

Posted on 2014-09-06
5
232 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

770 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