Solved

From 2 Tables to 1

Posted on 2002-07-18
4
164 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Familiarize people with the process of utilizing SQL Server views 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 Microsoft Access…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

710 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