Foxtable(狐表)用户栏目专家坐堂 → 求幅度时提示的错误。


  共有2518人关注过本帖树形打印复制链接

主题:求幅度时提示的错误。

帅哥哟,离线,有人找我吗?
大红袍
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/8/29 11:18:00 [显示全部帖子]

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 gjf As String=dt_pmsj.Compute("Max(" & dr("科目") & ")","[届别]='" & e.DataRow("届别") & "' And [考试期数] ='" & dr("考试期数") & "' And [年级]='" & dr("年级") & "' And [班别]='" & dr("班别") & "'")
            Dim djf As String=dt_pmsj.Compute("Min(" & dr("科目") & ")","[届别]='" & e.DataRow("届别") & "' And [考试期数] ='" & dr("考试期数") & "' And [年级]='" & dr("年级") & "' And [班别]='" & dr("班别") & "'")
            If gjf > "" AndAlso djf > "" Then
                e.DataRow("高幅度")=gjf.SubString(1,gjf.IndexOf("(")-1)
                e.DataRow("低幅度")=djf.SubString(1,djf.IndexOf("(")-1)
            End If
    End Select
End If

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/8/29 15:03:00 [显示全部帖子]

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

 回到顶部