Ah - was that YOUR thread earlier. I had to laugh when I read it, because I used the same thing in VFP3 apps a couple years ago. The biggest problem was teaching the end-users not to delete the blank records.
I've always written this code by hand in the second manner, so I wasn't aware until now about the View Builder problem. Frankly, if I need more than 2 tables invoved I get out my Modi Comm and hand-code it. Then run a CREATE VIEW.
Barbara
>This relates to a question I posted two days ago. Actually we've found that those cheezy blank rows (we use -1 ids) are faster than outer joins.
>
>Other than that we've also noticed that the way that VFP builds the SQL statment for complex outer joins is incorrect. Barb, correct me if I'm wrong.
>
>It builds this:
>
>select * ;
> FROM central!people ;
> LEFT OUTER JOIN central!firm;
> LEFT OUTER JOIN central!address ;
> ON People.firmid = Address.firmid ;
> ON People.firmid = Firm.firmid;
> WHERE People.last = "Smith"
>
>But it should build this:
>
>select * ;
> FROM central!people ;
> LEFT OUTER JOIN central!firm;
> ON People.firmid = Address.firmid ;
> LEFT OUTER JOIN central!address ;
> ON People.firmid = Firm.firmid;
> WHERE People.last = "Smith"
>
>The former returns the wrong subset. I think. Check it out yourself. I use gendbc to generate the code for my views and change the SQL by hand.
>
>paul