Solved

How to match fields from two tables

Posted on 2007-03-18
4
761 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

747 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

13 Experts available now in Live!

Get 1:1 Help Now