|
Prev: Can you create a table from the output of a query?
Next: Subtract positive number from negative number
From: John D on 3 Jul 2008 20:02 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 3 Jul 2008 21:46 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 5 Jul 2008 13:00 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 6 Jul 2008 03:09
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 > |