From: John D on
I have one Table with a 2 field Primary Key. A second Table has a 2 field
Index. Each of the 2 fields is defined the same in both Tables.

I want to Join the two Tables in a query on these 2 fields - one a Primary
Key in one Table, the other a 2-field non-Primary Index (known as a Secondary
Key in other databases).

But - I can't figure out how to do that on the query design form. Can anyone
help. Thanks in advance.

John D
From: strive4peace on
Hi John,

SELECT T1.[fieldname1], T1.[fieldname2], T2.[fieldname3]
FROM [TableName1] as T1
INNER JOIN [TableName2] as T2
ON T1.[fieldname1] = T2.[fieldname1]
AND T1.[fieldname2] = T2.[fieldname2]

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day :)
*




John D wrote:
> I have one Table with a 2 field Primary Key. A second Table has a 2 field
> Index. Each of the 2 fields is defined the same in both Tables.
>
> I want to Join the two Tables in a query on these 2 fields - one a Primary
> Key in one Table, the other a 2-field non-Primary Index (known as a Secondary
> Key in other databases).
>
> But - I can't figure out how to do that on the query design form. Can anyone
> help. Thanks in advance.
>
> John D
From: John D on
Crystal - turns out I made a really dumb mistake - I had added an extra
character into one of the fields in one table as a category code some months
ago, but forgot about it and didn't notice it when I was trying to make the
query work. And, of course, it couldn't work because the values were 1
character different.

Dumb - oh well. Now, of course, it works just fine. Thanks.

John D

From: strive4peace on
Hi John,

glad you got it sorted out ;) good luck with your project

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day :)
*




John D wrote:
> Crystal - turns out I made a really dumb mistake - I had added an extra
> character into one of the fields in one table as a category code some months
> ago, but forgot about it and didn't notice it when I was trying to make the
> query work. And, of course, it couldn't work because the values were 1
> character different.
>
> Dumb - oh well. Now, of course, it works just fine. Thanks.
>
> John D
>