第1部:copy to tmptable ... while ... for ... 根据条件生成一个表。
第2部:use tmptable
sum ... to array tmparray 或用其它统计方法,根据你的需要
append from array tmparrat fields fieldlist
第3部:copy to excelname type xls 导出数据到excel文件中
第4部:use 关闭临时表
delete file (tmptable+".dbf") 删除临时文件
-------------------------
我流落在凄凉的世界里-孤苦伶仃
我过着动荡无助的生活-四处漂泊
楼主试试如下代码:
appe blan
for i=1 to fcount()
if type(fiel(i))='N'
mfiel=fiel(i)
sum &mfiel. to msum
go bott
repl &mfiel. with msum
endi
endf
thisform.grd1.refresh