* Parent table for group header - Linkkey,p1,p2... * Child invoice table : Linkkey, s1,s2,... * Par-child reltions already set select linkkey, ; sum(s1) as s1total, ; sum(s2) as s2total, ; .... ; from invoice ; group by linkkey ; where .t. ; into cursor tcTempTotals use dbf("tcTempTotals") in 0 again alias tcTotals use in "tcTempTotals" select tcTotals index on linkkey tag linkkey select parenttable set relation to linkkey into tcTotals modify report myreport && Include in first run to easily add your sumfield *report form myreport to ....One pass SQL would be so complex for now.