Append query (1 Viewer)

npa3000

Member
Local time
Today, 12:30
Joined
Apr 16, 2021
Messages
36
Hello,

I have 2 tables where from one I want to transfer a column to the other based on an ID.

Specifically I have the PRODUCTS table with the fields PRODUCT_ID and TRANSLATION.
I also have the TEST table with ID and trans fields.

So I want to transfer all the trans fields from TEST to TRANSLATION of PRODUCTS based on ID.

I have created the query below but it doesn't work.

Code:
INSERT INTO PRODUCTS ( TRANSLATION )
SELECT test.trans
FROM test
WHERE (((test.ID)=[PRODUCTS].[PRODUCT_ID]));

Do you have any idea?
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:30
Joined
Feb 19, 2002
Messages
43,233
Insert queries insert new rows. Update queries update existing rows. Sounds like you want to update the existing rows so you need an update query.

In the QBE,
Add both tables.
Draw the join
Select the field from Products that you want to update
Change the query type to Update
In the update to row, add test.Translation (or whatever the table/column name actually is)
 

Users who are viewing this thread

Top Bottom