回复 20楼 sdta
好像不行 出错啊
use hz1
CALCULATE MIN(smzf) TO x FOR smzfjm<=INT(626*0.05)
?x
CLOSE DATABASES ALL USE hz1 IN 0 nRecc=RECCOUNT() CALCULATE Max(bj) TO nMax CREATE CURSOR tt (bj c(2),lb c(20),rs n(4)) cField="班级 c(2)" FOR i=1 TO INT(0.85/0.05) STEP 2 SELECT Hz1 CALCULATE MIN(Smzf) TO nMin FOR Smzfjm<=nRecc*0.05*i cField=cField+","+"F"+TRANSFORM(INT(nMin))+"以上"+" n(4)" INSERT INTO tt ; SELECT PADL(bj,2,"0"),"F"+TRANSFORM(INT(nMin))+"以上" ,; SUM(IIF(smzfjm<=INT(nRecc*0.05*i),1,0)) ; FROM hz1 GROUP BY bj ENDFOR CREATE CURSOR ttt (&cField) SELECT tt FOR i=1 TO nMax LOCAL aa[10,1] COPY TO ARRAY aa FIELDS rs FOR bj==PADL(i,2,"0") =AINS(aa,1) aa[1,1]=PADL(i,2,"0") DIMENSION aa[1,ALEN(aa,1)] INSERT INTO ttt FROM ARRAY aa RELEASE aa ENDFOR SELECT ttt BROWSE