以下是引用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
学习了