Multiple join question
I have a query something like:
select Tab1.xxx, Tab2.yyy, Tab3.zzz, and others
from Tab1
join Tab2 on Tab2.Inx=Tab1.Inx
join tab3 on (Tab3.Inx=Tab2.Inx and Tab3.Inx2=Tab1.Inx2)
which works fine as SQL but how do I create it in the data tab of my report?
Jeremy
PS I can't do it in Delphi as the report has to be in a database using DADE.
--
select Tab1.xxx, Tab2.yyy, Tab3.zzz, and others
from Tab1
join Tab2 on Tab2.Inx=Tab1.Inx
join tab3 on (Tab3.Inx=Tab2.Inx and Tab3.Inx2=Tab1.Inx2)
which works fine as SQL but how do I create it in the data tab of my report?
Jeremy
PS I can't do it in Delphi as the report has to be in a database using DADE.
--
This discussion has been closed.
Comments
Try this..
- use the Query Designer Tables page to define the joins for tab2 to tab1
and for tab3 to tab2
- use the Query Deisgner Search page to define a search criteria for
tab3.Inx and for the value specify tab1.Inx2.
select Tab1.xxx, Tab2.yyy, Tab3.zzz, and others
from Tab1
join Tab2 on Tab2.Inx=Tab1.Inx
join tab3 on Tab3.Inx=Tab2.Inx
where (Tab3.Inx2=Tab1.Inx2)
--
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
Ah, that's what I did try but the DB is DBISAM which comes back with an
error:
"DBISAM Engine Error # 11949 SQL parsing error - Table correlation name
Tab3 is the target of multiple join conditions in the WHERE or JOIN clause
in SELECT SQL statement".
Found it's to do with a different part of the query -I'd simplified it as
I was trying to see if I could link a table twice like that shown in the
tables page, but obviously not ! I'll hopefully find another way to do
what I am attempting.
Thanks though.
--