试试:
SELECT linshi
*GO BOTTOM
renshu = RECC()&&获得记录总数
GO TOP&&返回最顶开始
DIMENSION marray(renshu)&&根据记录总数定义一个数组存放姓名
FOR i=1 TO renshu STORE 姓名 TO marray(i) SKIP
ENDFOR
SELECT huojianjilu
FOR j=1 TO renshu SUMhuojianjilu.保管金额TO grje FOR ALLTRIM(huojianjilu.收款人员) = ALLTRIM(marray(j)) SUMhuojianjilu.货件数量TO grch FOR ALLTRIM(huojianjilu.存仓人员) = ALLTRIM(marray(j)) SUMhuojianjilu.货件数量TO grth FOR ALLTRIM(huojianjilu.提货人员) = ALLTRIM(marray(j)) SELECT linshi GO j REPLACE 存放金额 WITH grje REPLACE 存放数量 WITH grch REPLACE 提货数量 WITH grth
ENDFOR
sele 收款人员,sum(*) from huojianjilu group by 收款人员 into curs temp1
sele 存仓人员,sum(*) from huojianjilu group by 存仓人员 into curs temp2
sele 提货人员,sum(*) from huojianjilu group by 提货人员 into curs temp3
然后,按需要组织记录