问题:如何根据”优分线”中各科A、B1、B2、C优线的标准,对“成绩分析”表中各科成绩进行优生级别划分?
说明:以语文科为例:“语文”科“A优线”为“142分”,则“成绩分析”表中“语文”成绩高于或等于142分的,均在相应的“语优”中确定等级为“A”;同理语文成绩在133分以上、低于142分为“B1”,126分及以上、低于133分相应等级为B2,117分及以上、低于126分相应“语优”为“C“。其它科目类推。
以下是引用czy在2009-3-30 18:24:00的发言:
Dim ColNames() As String = {"语文","数学","英语","物理","化学","总分"}
Dim dt2 As DataTable = DataTables("优分线")
Dim dr As DataRow
For Each Name As String In ColNames
For Each dr1 As DataRow In DataTables("成绩分析").DataRows
dr = dt2.Find("[月份] = '" & dr1("月份") & "' And [科目] = '" & Name & "'")
If dr IsNot Nothing Then
dr1(Name.SubString(0,1) & "优") = iif(dr1(Name)>=dr("A优线"),"A",iif(dr1(Name)>=dr("B1优线"),"B1",iif(dr1(Name)>=dr("B2优线"),"B2",iif(dr1(Name)>=dr("C优线"),"C",""))))
End If
Next
Next
学习了