Table Combined

P

PA

Dear All,

I have one existing table at database 2 (new database-Table B), and the
other table at database 1 (old database-table Y).For example:

Table B at database 2

CustID Product_ Qty Sales $
111 TTT 20 $4000
222 KKK 10 $2300
444 HHH 14 $1890


Table Y at database 1

CustID Product_ Qty Sales $
115 UUU 15 $4500
225 JJJ 5 $1300
479 HHH 14 $1890

If I want to combine the table Y (from old database or database1) into the
table B in the new database (database 2), like below’s table:

CustID Product_ Qty Sales $
111 TTT 20 $4000
222 KKK 10 $2300
444 HHH 14 $1890
115 UUU 15 $4500
225 JJJ 5 $1300
479 HHH 14 $1890


What should I do when I import it?

I know I could combined them by Union Query (so both tables are in one
query), but if I want they are inâ€TABLE†(Not “Queryâ€), is there any solution
for this?

Appreciate your help and advise as usual


Many Thanks & Best Regards

Poimin
 
K

Klatuu

One consideration you did not address is how you will handle the same
CustID/Product combination in both tables. For example, if CustID 222
/Product KKK exists in both tables, do you want a row in the destination for
each occurance or do you want them summed to one row?

You could link to the table in the old databse and use an append query to
copy the records from it into the new database; however, if the same CustID
exists and it is defined as no duplicates, you will have a problem.

A union query would work for starters. You could use it as the source of an
append query to combine both the old and new into one.
 
P

PA

Klatuu,


I will have alook to the Append query that you mention (which is new for me
as well).

Many thanks

PA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top