Link tables question

G

George

Hi,
I have the following tables that i need to link.
Table 1 "account table" has all the account names and client names and
account numbers,e.g
Field 1 Field 2 Field 3
a/c name client name client code
A/C#1 J. Smith 2242
A/C#1 T.Lock 4432
A/c#4 T.Lock 4432
A/C#2 J.Smith 3322
A/c#3 U.Whitney 9789
Some clients invest in more than 1 account names and have more than 1 client
code. Some clients have the same client code and are in different account
names. This cannot be changed.
Table 2 has the account name and client name but no client code with other
data.
I have tried to link the tables - (there is no PKey) with the client name
and account name but it doesn't seem to work. Can some one suggest a way to
write a query that grabs the client code from table 1 and all the other data
from table 2?
Thanks
George
 
M

Michel Walsh

Hi,


Should work, you have to have two lines, in the editor, for the join, or, in
SQL view, something like:


SELECT ...
FROM table1 INNER JOIN table2
ON table1.Account = table2.Account
AND table1.clientName = table2.clientName
....


There should be no duplication problem if (table1.Account,
table1.ClientName), as a couple, is unique, without duplicated values (in
either table)


Hoping it may help,
Vanderghast, Access MVP
 
Top