Solved

How to match fields from two tables

Posted on 2007-03-18
4
765 Views
Last Modified: 2012-05-12
Hi All,

I exported an excel spreadsheet into the database. The excel spreadsheet has been converted into a table called Sales, this table has a field called SalesArea. I also have another table in the database called SalesSummary with field called SalesArea as well.

The fields should match each other, but the person maintaining the spreadsheet has slightly misspelled some data in the SalesArea field from the Sales table.

How can I identify the records that do not match for the field SalesArea from both tables?

Thanks
0
Comment
Question by:jose11au
  • 2
4 Comments
 
LVL 8

Assisted Solution

by:infolurk
infolurk earned 250 total points
ID: 18746528
Create a find unmatched query. It is an option when you create a new query. It has a wizard that guides you through.
Otherwise, the sql would look something like;
SELECT Sales.SalesArea
FROM Sales LEFT JOIN SalesSummary  ON Sales.SalesArea = SalesSummary.SalesArea
WHERE (((SalesSummary.SalesArea) Is Null));

Cheers
Steve
0
 
LVL 42

Accepted Solution

by:
dqmq earned 250 total points
ID: 18746536
Select  sales.* From sales
where sales.salesarea not in
(select salessummary.salesarea from salessummary)



0
 

Author Comment

by:jose11au
ID: 18746760
Thanks guys. Both answers work OK.

I'll split the point.

Regards.
0
 
LVL 8

Expert Comment

by:infolurk
ID: 18752907
No worries.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Familiarize people with the process of utilizing SQL Server stored procedures 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 Micr…
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…

679 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