Copying a column from one imported table to another

Status
Not open for further replies.

naveen327

New Member
Joined
Jul 17, 2007
Messages
13
Hi I have imported two different CSV files (A.csv and B.csv) into two different tables (tbl_A and tbl_B) respectively using a VBA Import function.

When I try to update a col_product (which is empty) in tbl_A with data from col_product in tbl_B on a inner join between column concat in tbl_A and col_concat in tbl_B.

My update query looks like this......
UPDATE tbl_A SET tbl_A.Product = (SELECT tbl_B.Product
FROM tbl_B INNER JOIN tbl_A ON tbl_A.Concat=tbl_B.Concat);

The select subquery within the update returns 488 rows with the products but when I run the update query it shows 488 rows which are blank?

Note: Should I be telling the update query exactly which rows to update on in tbl_A? The problem with that is the primary key for both tables is an autonumber.

Any help would be much appreciated.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Status
Not open for further replies.

Forum statistics

Threads
1,214,787
Messages
6,121,565
Members
449,038
Latest member
Guest1337

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top