Solved

From 2 Tables to 1

Posted on 2002-07-18
4
161 Views
Last Modified: 2012-08-13
EE,
I have two Tables within an Access 2000 db.
They are from separate companies but regarding the same products (vitamins).
I am unable to accurately link the tables on a unique identifier (in this case SKU's) as one company uses the original SKU and other company has altered some (but not all) of them.

For this reason (I believe), I am unable to link the tables on the SKU and enforce referential integrity. I get an error message. There are however, a large number of SKU's that do in fact match.

What I would like to do, is with the products that have SKU's that DO match, take the contents of the "description" field from one table and add it to the other table.

This may sound odd, but I want to make a single comprehensive table of these products that I can then use as a single table database to generate .php pages.
Even though it will be incomplete, there should be about 600-700 SKU matches. A good starting point.

Thanks.
dresdena1


0
Comment
Question by:dresdena1
  • 2
  • 2
4 Comments
 
LVL 54

Expert Comment

by:nico5038
ID: 7163362
I would start with a select that joins these tables on the SKU and show SKU and the description of both, thus the user can verify these are correct.
Then you can change this select query into a maketable (or append) query to fill the final table.
Next you link the "other" companies table with this final table and force all rows to appear (LEFT join you get by double clicking the join line and option 2 or 3). When you add under the SKU the criterium Is Null, then all mismatches will show.
For these you could try to create a form showing the desciptions of the mismatches and those of the final table and thus enabling the user to correct the SKU's from the second company.

Clear ?

Nic;o)
0
 

Author Comment

by:dresdena1
ID: 7164643
Hi Nico,
The first part worked like a charm. I was wrong however, there are just over 1100 matching records. Excellent!

The second part I am having trouble with.
I am unable to get the other companies table to link correctly with the "New" table.

I go into "Query Design View"
Select all three tables
1)Join 1 old table to the new table on the SKU
2)Double click Join line--> choose option 2
3)Change to a Maketable Query and give it a new name
4)Select SKU from New Table and 1 Old Table for the Query
5)Select Product Name from New Table for the Query
6)Type Null (changes to "Is Null") under Criteria for both SKU entries
7)Try to run Query and get the following error message:
<<
The SQL statement could not be executed because it contains ambiguous outer joins. To force one of the joins to be performed first, create a separate query that performs the first join and then include that query in your SQL statement.
<<

Do you know what I am doing wrong?

Being able to easily identify the remaining 500 entries that did not match would be extremely helpful.

Thank you for your help.
dresdena1
0
 
LVL 54

Accepted Solution

by:
nico5038 earned 100 total points
ID: 7165156
Just start with the two tables:
1) The new "final" and the "othercompany"
Then:
Select all three tables
1)Join tables on the SKU
2)Double click Join line--> choose option 2 (or 3) make "othercompany" the "leading one.
3)Select SKU from New Table and "othercompany" for the Query
4)Select Product Name from New Table and "othercompany"
5)Type Null (changes to "Is Null") under Criteria for "New" table SKU entries

This will list the unmatching rows from the "othercompany" table.

When you make a form and use the above unmatch query as a datasheet subform and also show the "New" table besides that with SKU and description (order for both on description), the comparison should be rather easy.
By updating the SKU in the "othercompany" table to an existing "New" code, it will disappear from the unmatched list...

Nic;o)
0
 

Author Comment

by:dresdena1
ID: 7185460
Thanks Nico!
dresdena1
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
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…
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…

749 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