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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Join on a join on a join????!!!!!!

Status
Not open for further replies.

Dineedshelp

Technical User
Sep 27, 2002
44
0
0
GB
Hi,

I have two tables that I need to join together, table a and table b. (Thats the easy bit!!!). Within table a and b I have three fields clientref, locationref, ward ref. All the records within my table have only one of either clientref, locationref, wardref. These are the only three columns that link the tables.
How can I join them together?
Could I use an if statement?

Help, its Friday!!!!!!
 
Code:
select xyz
from taba,tabb
where a.clientref = b.clientref
or a.locationref = b.locationref
or a.[ward ref] = b.[ward ref]

[bandito] [blue]DBomrrsm[/blue] [bandito]
 
Not working, comes back with the error:
invalid name for locationref and wardref
 
can you post your code and the full error message

[bandito] [blue]DBomrrsm[/blue] [bandito]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top