dr("语文有效分/人数") = DataTables("成绩库").Compute("count(单位)", " 语文 >= '" & ldr("语文B") & "' And 总分 >= '" & ldr("总分B") & "' And [部别] = '" & dr("部别") & "' And [年级] = '" & dr("年级") & "' And [类别] = '" & dr("类别") & "'")
dr("数学有效分/人数") = DataTables("成绩库").Compute("count(单位)", " 数学 >= '" & ldr("数学B") & "' And 总分 >= '" & ldr("总分B") & "' And [部别] = '" & dr("部别") & "' And [年级] = '" & dr("年级") & "' And [类别] = '" & dr("类别") & "'")
dr("英语有效分/人数") = DataTables("成绩库").Compute("count(单位)", " 英语 >= '" & ldr("英语B") & "' And 总分 >= '" & ldr("总分B") & "' And [部别] = '" & dr("部别") & "' And [年级] = '" & dr("年级") & "' And [类别] = '" & dr("类别") & "'")
dr("物理有效分/人数") = DataTables("成绩库").Compute("count(单位)", " 物理 >= '" & ldr("物理B") & "' And 总分 >= '" & ldr("总分B") & "' And [部别] = '" & dr("部别") & "' And [年级] = '" & dr("年级") & "' And [类别] = '" & dr("类别") & "'")
dr("化学有效分/人数") = DataTables("成绩库").Compute("count(单位)", " 化学 >= '" & ldr("化学B") & "' And 总分 >= '" & ldr("总分B") & "' And [部别] = '" & dr("部别") & "' And [年级] = '" & dr("年级") & "' And [类别] = '" & dr("类别") & "'")
dr("生物有效分/人数") = DataTables("成绩库").Compute("count(单位)", " 生物 >= '" & ldr("生物B") & "' And 总分 >= '" & ldr("总分B") & "' And [部别] = '" & dr("部别") & "' And [年级] = '" & dr("年级") & "' And [类别] = '" & dr("类别") & "'")
dr("政治有效分/人数") = DataTables("成绩库").Compute("count(单位)", " 政治 >= '" & ldr("政治B") & "' And 总分 >= '" & ldr("总分B") & "' And [部别] = '" & dr("部别") & "' And [年级] = '" & dr("年级") & "' And [类别] = '" & dr("类别") & "'")
dr("历史有效分/人数") = DataTables("成绩库").Compute("count(单位)", " 历史 >= '" & ldr("历史B") & "' And 总分 >= '" & ldr("总分B") & "' And [部别] = '" & dr("部别") & "' And [年级] = '" & dr("年级") & "' And [类别] = '" & dr("类别") & "'")
dr("地理有效分/人数") = DataTables("成绩库").Compute("count(单位)", " 地理 >= '" & ldr("地理B") & "' And 总分 >= '" & ldr("总分B") & "' And [部别] = '" & dr("部别") & "' And [年级] = '" & dr("年级") & "' And [类别] = '" & dr("类别") & "'")
怎么上述代码与下面代码执行结果不一样?请指教。谢谢!
Dim km1s() As String = {"语文","数学","英语","物理","化学","生物","政治","历史","地理"}
For Each km1 As String In km1s
dr(km1 & "有效分/人数") = DataTables("成绩库").Compute("count(单位)", " '" & km1 & "' >= '" & ldr(km1 & "B") & "' And 总分 >= '" & ldr("总分B") & "' And [部别] = '" & dr("部别") & "' And [年级] = '" & dr("年级") & "' And [类别] = '" & dr("类别") & "'")
Next