求助各位大神,帮帮忙,写个小程序
现在有一个总表,里面有准考证号,姓名,总分这三个字段,现在请各位大神写写一个程序,
要求统计总分>700分,700到600,600到500,500到400,400到300,<300,这几个分数段的人数,还有这几个分数段累计人数
* 假设:总分为整数。以下代码对分数段的临界值作了稍许改动 local nSum,nNum,cFor close all use 成绩表 alias test in 0 create cursor curResult (分数段 c(10),人数 i,累计 i,条件 c(50)) insert into curResult (分数段,条件) values ('>=700','总分>=700') insert into curResult (分数段,条件) values ('600-699','between(总分,600,699)') insert into curResult (分数段,条件) values ('500-599','between(总分,500,599)') insert into curResult (分数段,条件) values ('400-499','between(总分,400,499)') insert into curResult (分数段,条件) values ('300-399','between(总分,300,399)') insert into curResult (分数段,条件) values ('<300','总分<300') nSum = 0 scan cFor = alltrim(条件) calculate cnt() to nNum for &cFor in test nSum = nSum + nNum replace 人数 with nNum,累计 with nSum endscan go top browse field 分数段,人数,累计