select NVL(arcash99.invno, arycsh99.invno) AS invno; > sum(NVL(arcash99.paidamt,0) + NVL(arycsh99.paidamt,0)) as cashpaid ; > from arcash99 ; > FULL OUTER JOIN arycsh99 ON arcash99.invno = arycsh99.invno ; > where ( ISNULL(arcash99.artype) OR empty(arcash99.artype) ; > AND (ISNULL(arycsh99.artype) OR empty(arycsh99.artype)) ; > GROUP BY 1 ; > INTO CURSOR CURS2 >>
>>select arcash99->invno, ; >> sum(arcash99->paidamt) as cashpaid ; >> from arcash99 ; >> where empty(arcash99.artype) ; >> GROUP BY arcash99.invno ; >>UNION ; >> select arycsh99->invno, ; >> sum(arycsh99->paidamt) as cashpaid ; >> from arycsh99 ; >> where empty(arycsh99.artype) ; >> GROUP BY arycsh99.invno ; >> INTO CURSOR CURS1 >> >>select CURS1->invno, ; >> sum(CURS1->cashpaid) as cashpaid ; >> from CURS1 ; >> GROUP BY CURS1.invno ; >> INTO CURSOR CURS2 >>