Select Case e.DataCol.Name
Case "bz1"
If e.DataRow("bz1")="1"
Dim Filter As String = "[bz1] = '1' and [yy] = '" & e.DataRow("yy") & "'and [yy1] = '" & e.DataRow("yy1") & "' "
If Filter IsNot Nothing Then
e.DataRow("gtds") = DataTables("wy_cpd").Compute("Sum(jsds)", Filter)
End If
ElseIf e.DataRow("bz1")="2"
Dim Filter As String = "[bz1] = '2'and [yy] = '" & e.DataRow("yy") & "'and [yy1] = '" & e.DataRow("yy1") & "' "
If Filter IsNot Nothing Then
e.DataRow("gtds") = DataTables("wy_cpd").Compute("Sum(jsds)", Filter)
End If
ElseIf e.DataRow("bz1")="3"
Dim Filter As String = "[bz2] = '3'and [yy] = '" & e.DataRow("yy") & "'and [yy1] = '" & e.DataRow("yy1") & "' "
If Filter IsNot Nothing Then
e.DataRow("gtds") = DataTables("wy_cpd").Compute("Sum(jsds)", Filter)
End If
ElseIf e.DataRow("bz1")="4"
Dim Filter As String = "[bz2] = '4'and [yy] = '" & e.DataRow("yy") & "'and [yy1] = '" & e.DataRow("yy1") & "' "
If Filter IsNot Nothing Then
e.DataRow("gtds") = DataTables("wy_cpd").Compute("Sum(jsds)", Filter)
End If
ElseIf e.DataRow("bz1")="5"
Dim Filter As String = "[bz2] = '5'and [yy] = '" & e.DataRow("yy") & "'and [yy1] = '" & e.DataRow("yy1") & "' "
If Filter IsNot Nothing Then
e.DataRow("gtds") = DataTables("wy_cpd").Compute("Sum(jsds)", Filter)
End If
ElseIf e.DataRow("bz1")="6"
Dim Filter As String = "[bz2] = '6'and [yy] = '" & e.DataRow("yy") & "'and [yy1] = '" & e.DataRow("yy1") & "' "
If Filter IsNot Nothing Then
e.DataRow("gtds") = DataTables("wy_cpd").Compute("Sum(jsds)", Filter)
End If
End If
End Select
wy_cpd表中都bz1、bz2 wy_gt表中有bz1 为什么到bz1=5和6时不会执行计算,其他都可以的