Would it work if changed to something like this?
Select custid,sum(cost) as cost from orders into cursor tmp1 where cType = 'fruit' group by custid
Select custid,sum(cost) as cost from orders into cursor tmp2 where cType = 'beverage' group by custid
Select company.custid,companyname,tmp1.cost as fruitcost, tmp2.cost as BeverageCost From company LEFT JOIN tmp1 ON company.id=tmp1.custid LEFT JOIN tmp2 ON company.id = tmp2.custid
Into cursor tmp3
I am wondering if the syntax on the join would work since I have 12 actual subselects and the way that you originally had it would involve more temp cursors.
Derek Agar
Acctware Business Systems
derekagar@acctware.comICQ: 42332100
***********************
When in trouble call 911
He that dwelleth in the secret place
of the most High shall abide under
the shadow of the Almighty.
Psalm 91:1
***********************