If e.DataRow.IsNull("科目")=False Then Select Case e.DataCol.name Case "届别","考试期数","年级","班别","科目" Dim dr As DataRow=e.DataRow Dim dt_StudentScore As DataTable=DataTables("StudentScore") Dim dt_pmsj As DataTable=DataTables("排名升降") Dim filter As String = "[届别]='" & e.DataRow("届别") & "' And [考试期数] ='" & dr("考试期数") & "' And [年级]='" & dr("年级") & "' And [班别]='" & dr("班别") & "' and " & dr("科目") & " like '↑%'" Dim dmax As DataRow = dt_pmsj.Find(filter, dr("科目") & " desc") Dim dmin As DataRow = dt_pmsj.Find(filter, dr("科目")) If dmax IsNot Nothing Then e.DataRow("高幅度")=dmax(dr("科目")).SubString(1,dmax(dr("科目")).IndexOf("(")-1) e.DataRow("低幅度")=dmin(dr("科目")).SubString(1,dmin(dr("科目")).IndexOf("(")-1) e.DataRow("高幅分")=dt_StudentScore.Compute("Max(" & dr("科目") & ")","[届别]='" & e.DataRow("届别") & "' And [考试期数]='" & e.DataRow("考试期数") & "' And [年级]='" & dr("年级") & "' And [班别]='" & dr("班别") & "' and 姓名 = '" & dmax("姓名") & "'") e.DataRow("低幅分")=dt_StudentScore.Compute("Min(" & dr("科目") & ")","[届别]='" & e.DataRow("届别") & "' And [考试期数]='" & e.DataRow("考试期数") & "' And [年级]='" & dr("年级") & "' And [班别]='" & dr("班别") & "' and 姓名 = '" & dmin("姓名") & "'") e.DataRow("高姓名") = dmax("姓名") e.DataRow("低姓名") = dmin("姓名") End If End Select End If
|