JS-Q4: Merging tables

J

Jack Sheet

Sorry to trouble all y'all again.

I have two tables "T_Clients" and "T_YearEnds".
Each has an identical key field (ClientRef)
The tables have a one-to-one relationship set up on the key fields with
enforced referential integrity.
I find that there is no point in keeping the data in two datasheets, and I
wish to merge the "T_YearEnds" fields into "T_Clients" datasheet. I have
set up fields (all currently blank) in T_Clients, but have ground to a halt
trying to import the data from T_YearEnds.

It sounds like an "update query" is required, but cannot work out the
syntax. Any help appreciated.

PS: please ignore character string JS-Q4 in subject header.
 
J

John Spencer

Set up a select query and then change that to an update query.

UPDATE T_Clients INNER JOIN T_YearEnds
ON T_Clients.ClientRef = T_YearEnds.ClientRef
SET T_Clients.SomeField = T_YearEnds.SomeCorrespondingFields
T_Clients.AnotherField = T_YearEnds.AnotherCorrespondingField
 
J

Jack Sheet

Worked like a charm. Thanks.

John Spencer said:
Set up a select query and then change that to an update query.

UPDATE T_Clients INNER JOIN T_YearEnds
ON T_Clients.ClientRef = T_YearEnds.ClientRef
SET T_Clients.SomeField = T_YearEnds.SomeCorrespondingFields
T_Clients.AnotherField = T_YearEnds.AnotherCorrespondingField
 
J

Jack Sheet

Thanks Bob
I had thought that might be the way to go but John Spencer solved it for me.
Thanks for looking at it anyway.
 

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