老师,下面代码分别是从基础表中统计汇总月本数、本年数、以前合计,可是设置代码后并不计算也不提示错误,请老师帮忙看一下是怎么回事??
If e.DataCol.Name = "债务编码" Then
Dim filter1 As String = "债务编码 = '" & e.DataRow("债务编码") & "' And 年度 = '" & e.DataRow("年度") & "'And 月份 = '" & e.DataRow("月份") & "'"
e.DataRow("本月举借") = DataTables("债务举借明细表").Compute("sum(举借金额)",filter1 )
e.DataRow("本月偿还") = DataTables("平台还本付息明细表").Compute("sum(偿还本金)",filter1 )
e.DataRow("本月支付") = DataTables("平台还本付息明细表").Compute("sum(偿还利息)",filter1 )
End If
If e.DataCol.Name = "债务编码" Then
Dim filter2 As String = "债务编码 = '" & e.DataRow("债务编码") & "' And 年度 = '" & e.DataRow("年度") & "'And 月份 <= '" & e.DataRow("月份") & "'"
e.DataRow("本年举借") = DataTables("债务举借明细表").Compute("sum(举借金额)",filter2 )
e.DataRow("本年偿还") = DataTables("平台还本付息明细表").Compute("sum(偿还本金)",filter2 )
e.DataRow("本年支付") = DataTables("平台还本付息明细表").Compute("sum(偿还利息)",filter2 )
End If
If e.DataCol.Name = "债务编码" Then
Dim filter3 As String = "债务编码 = '" & e.DataRow("债务编码") & "' And 年度 < '" & e.DataRow("年度") & "'"
e.DataRow("以前年度举借") = DataTables("债务举借明细表").Compute("sum(举借金额)",filter3 )
e.DataRow("以前年度还本") = DataTables("平台还本付息明细表").Compute("sum(偿还本金)",filter3 )
e.DataRow("以前支付") = DataTables("平台还本付息明细表").Compute("sum(偿还利息)",filter3 )
End If