老师,我表A有列名为“科目代码”,其规则是1001、1002、1004等都是四位数的,在表B有列名为“科目名称”,科目名称中包含表A的“科目代码”。比如表B的科目名称为100101\现金\人民币;100102\现金\美元。现在我要在表A的科目代码为1001的行统计表B中科目名称中包含1001的合计数据。下面是我的代码,得到的结果全是0If e.DataCol.Name = "科目代码" OrElse e.DataCol.Name = "年度" OrElse e.DataCol.Name = "月份" Then
Dim Str1 As String = e.DataRow("科目代码")
If Str1 > "" AndAlso Str1.Contains(e.DataRow("科目名称")) Then
Dim filter1 As String = "年度 = '" & e.DataRow("年度") & "' And 月份 <= '" & e.DataRow("月份") & "'"
e.DataRow("借方本期") = DataTables("凭证明细表").Compute("sum(借方金额)" ,filter1 And "科目代码 Like & value &")
Else
e.DataRow("借方本期") = 0
End If
End If
再麻烦老师。。。实在不好意思。。。