老师,麻烦看看我跨表统计出来结果不对呢,怎么去看filter统计了那些值呢?
If e.DataCol.Name = "增收类别" Then
If e.DataRow.IsNull("增收类别") Then
e.DataRow("成本fa piao") = Nothing
e.DataRow("可抵扣进项税额") = Nothing
ElseIf e.DataRow("增收类别") = "标准增收" Then
e.DataRow("应缴税额")=e.DataRow("开piao金额")/1.1*0.1
e.DataRow("预缴税额")=e.DataRow("开piao金额")/1.1*0.02
Dim filter1 As String = "合同编码='" & e.DataRow("合同编码") & "'and 计量期数='" & e.DataRow("计量期数") & "'"
e.DataRow("成本fa piao") = DataTables("进项piao审核").sqlCompute("sum(税后金额)", filter1 & " And 审核状态='已审核' and 类别 in ('普piao','专piao','人工工资')")
e.DataRow("可抵扣进项税额") = DataTables("进项piao审核").sqlCompute("sum(税额)", filter1 & " And 审核状态='已审核' and 类别='专piao'")
End If
End If
用filter,用sqlCompute统计出来和用Compute统计出来为什么不一样呢?
[此贴子已经被作者于2018/10/22 13:59:41编辑过]