For j As Integer=5 To am-1
Dim hm As String=Tables(ksmc).Cols(j).Name
Dim ckrs As Integer=0
Dim yxrs As Integer=0
Dim hgrs As Integer=0
dr(hm & "_平均分") = DataTables("单元测试1").Compute("Avg(语文)","学校 = '" & nm(0) & "' And [年级] = '" & nm(1) & "' And [班级] = '" & nm(2) & "'")
yxrs=DataTables("单元测试1").Compute("Count(语文)","语文>=90")
hgrs= DataTables("单元测试1").Compute("Count(语文)","语文>=60")
ckrs= DataTables("单元测试1").Compute("Count(编号)")
dr(hm & "_优秀率") = DataTables("单元测试1").Compute(yxrs/ckrs*100 ,"学校= '" & nm(0) & "' And [年级] = '" & nm(1) & "' And [班级] = '" & nm(2) & "'") dr(hm & "_合格率") = DataTables("单元测试1").Compute(hgrs/ckrs*100 ,"学校= '" & nm(0) & "' And [年级] = '" & nm(1) & "' And [班级] = '" & nm(2) & "'")
Next
红色部分计算结果不正确