有条件跨表统计,计算结果不对,不知错在哪?
'跨表求和库明细表累计出库金额列(有配合)
Select Case e.DataCol.Name
Case "月份","项目ID","工料一类"
Dim Filter As String = "[月份] = '" & e.DataRow("统计月") & "' and [项目ID] = '" & e.DataRow("项目ID") & "'"
e.DataRow("劳务消耗额") = DataTables("库明细").Compute("Sum(累计出库金额)","[工料一类] = '劳务'")
e.DataRow("材料消耗额") = DataTables("库明细").Compute("Sum(累计出库金额)","[工料一类] = '材料'")
e.DataRow("机械消耗额") = DataTables("库明细").Compute("Sum(累计出库金额)","[工料一类] = '机械'")
End Select