Solved

Find unmarched records based on multiple columns

Posted on 2014-09-06
5
229 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
Comment Utility
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
Comment Utility
the problem is I need to match ten columns, not one.
0
 
LVL 28

Expert Comment

by:sammySeltzer
Comment Utility
Did you run this code?

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

Author Comment

by:ssmith94015
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now