
SELECT . INNER JOIN--INNER JOIN
Quote:
> I'm not a SQL expert but that syntax doesn't appear to be a valid SQL
> command (at least for Oracle) and it reminds me of SQL that MS Access
spits
> out when you view one of its queries in SQL mode. It could be that you
are
> missing parenthesis around your conditions.... I remember Access being
> extremely picky....
> The proper SQL for your query (which I believe will still work in Access)
> is:
> "select ta1.name, ta2.gruppe, ta3.zubereitung from ta1, ta2, ta3 where
> ta1.GrupID = ta2.ID2 and ta1.ZubID = ta3.ID3;"
> Where the AND's are implicit inner joins....
> If all else fails -- and I've done this many times wrestling with
Access...
> use the design query and do your query graphically.. then switch to the
SQL
> view to see what it gives you.
> Regards,
> Shelby Cain
> > Thank you Shelby for your hint.
> > Unfortunately the missing blanc was only in my email, not in my program.
> > The following (corrected) SQL produces the error:
> > SQL = "Select ta1.Name, ta2.Gruppe, ta3.Zubereitung " & _
> > "FROM ta1 " & _
> > "INNER JOIN ta2 ON ta1.GrupID = ta2.ID2 " & _
> > "INNER JOIN ta3 ON ta1.ZubID = ta3.ID3;"
> > ERROR: 2147217900(80040e14)
> > Syntax Error: missing operator in:
> > 'ta1.GrupID = ta2.ID2 INNER JOIN ta3 ON ta1.ZubID = ta3.ID3'
> > Each one of the INNER JOINs separately works fine
> > only the combination failes.
> > Do you have another idea?
> > Regards
> > Klaus Eckert
Newsbeitrag
> > > > SQL = "Select ta1.Name, ta2.Gruppe, ta3.Zubereitung " & _
> > > > "FROM ta1 " & _
> > > > "INNER JOIN ta2 ON ta1.GrupID = ta2.ID2" & _
> > > > "INNER JOIN ta3 ON ta1.ZubID = ta3.ID3; "
> > > One thing the could be wrong is the lack of a space after ta2.ID2 in
> your
> > > first join. The resultant string would read something like:
> > > INNER JOIN ta2 ON ta1.GrupID = ta2.ID2INNER JOIN ta3 ON ta1.ZubID =
> > ta3.ID3;
> > > instead of what you are expecting...
> > > Regards,
> > > Shelby Cain
Hi Shelby,
It's great, it works fine!
I am enthused about your constructive and very quick answer.
Your solution with the implicite INNER JOINs is much more understandable
than the explicite INNER JOINs!
Please don't say once more that you aren't an SQL expert, you are!
I guess that the Access-database wanted your 'AND'
when asking impertinently for the missing operator.
Thank you very much Shelby
Regards
Klaus Eckert