Solved

From 2 Tables to 1

Posted on 2002-07-18
4
150 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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

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

22 Experts available now in Live!

Get 1:1 Help Now