Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Multiple join question

edited August 2006 in General
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.

--

Comments

  • edited August 2006

    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
  • edited August 2006
    Nard Moseley (Digital Metaphors) wrote:


    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".
  • edited August 2006
    Jeremy Knowles wrote:


    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.

    --
This discussion has been closed.