Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Joining on two fields

Status
Not open for further replies.

MikeRBS

IS-IT--Management
Apr 15, 2004
81
GB
I have two tables with names - Firstname and Surname. If I do the following:

SELECT T1.Surname,
People.Surname,
T1.Forename,
People.Firstname
FROM T1 RIGHT JOIN People ON ((T1.Surname = People.Surname) AND (T1.Forename = People.Firstname))

..it runs alright but says it "can't represent the join in Design View". Is there a way to do two-field joins within QBE? The reason is I want to do updating and appending and I don't want to have to write raw SQL unnecessarily.
 
If you try to drag two fields, it gives you a not allowed mouse pointer. If you do the two individually, it complains about ambiguous joins. If you do in it SQL, QBE says it can't deal with it.
 
hi

different col names, same logic

SELECT tblExpensesItems.*, tblProperties.*
FROM tblExpensesItems INNER JOIN tblProperties ON (tblExpensesItems.strHouseNumber = tblProperties.strHouseNumber) AND (tblExpensesItems.strContract = tblProperties.strContract);


Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hi Ken.

Does your SQL get accepted by QBE? If so it must be the outer join...
 
Hi


Yes, I got the SQL by switching from QBE view to SQL view, as you say it is almost certainly the use of the outer join

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top