>>>If you need to join the SECOND table to the third, the syntax becomes a little more involved; you have to insert stuff between the JOIN and ON, thusly:
>>>
>>>
>>>sele a.pn ;
>>> from pnvendor a;
>>> left join inv b;
>>> left join Table3 on b.KeyField = Table3.KeyField;
>>> on a.pn = b.pn ;
>>> where [SomeCondition]
>>>
>>>
>>>Note that I alligned the first LEFT and the last ON, to indicate they go together.
>>>
>>
>>Actually, you don't have to.
>
>Yes, I know. Allignment is irrelevant for VFP. It helps the programmer keep things clear - and the reason I pointed this out is to indicate which commands go together. Understanding this can be important for more complicated queries.
I mean you don't have to nest them. This works the same, and is easier to read.
sele a.pn ;
from pnvendor a;
left join inv b on a.pn = b.pn ;
left join Table3 on b.KeyField = Table3.KeyField ;
where [SomeCondition]
Insanity: Doing the same thing over and over and expecting different results.