SELECT *, SUM(sotrans.numunits) AS sumunits, SUM(sotrans.amount) AS sumamt ;
FROM sotrans,soheader,custaddr WHERE ;
sotrans.sono=soheader.sono AND ;
custaddr.custno=soheader.custno ;
ORDER BY custaddr.shipto ;
GROUP BY custaddr.shipto
>How does VFP optimize a query when using join clauses?
>
>I have to get data from 2 children tables. The link is via the parent.
>
>Parent : SoHeader has customer ship to # and SoNo and CustNo
>Child1 : SoTrans has what was ordered, and SoNo
>Child2 : CustAddr has Customer ship to address.
>
>I need to get $s and # of units totals from SOTrans, and group them by each ship to location.
>
>So do you start at the parent, or a child in the SQL when using joins?
>
>TIA
>
>__Stephen Russell------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05