程序代码:
* 生成TJ表结构 select cpno,left(dtos(dataa),6) ny,code from tt group by cpno,ny,code into array aa crq="cpno c(10),ny c(6),code c(10)," for i=1 to 31 crq=crq+"d"+padl(i,2,"0")+" c(6)," endfor crq=left(crq,len(crq)-1) create cursor tj (&crq) * 添加统计内容 append from array aa index on cpno+ny+code to cnc *browse * 开始统计处理 select cpno,left(dtos(dataa),6) ny,right(dtos(dataa),2) cday,code,chuli from tt into cursor ttt select ttt set relation to cpno+ny+code into tj scan replace ("D"+ttt.cday) with ttt.chuli in tj endscan set relation to * 浏览统计结果 select tj browse
看下结果是否正确
坚守VFP最后的阵地