JS-Q4: Merging tables

  • Thread starter Thread starter Jack Sheet
  • Start date Start date
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.
 
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
 
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
 
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.
 
Back
Top