-- 作者:石四
-- 发布时间:2015/1/24 12:59:00
-- 肿么办?
重复了:
For Each nm() As String In dt1.GetValues("客户名称|年|月") For Each nv() As String In dt2.GetValues("客户名称|年|月") Dim dr As Row = Tables("财务_Table1").AddNew() dr("客户名称") = nm(0) dr("年") = nm(1) dr("月") = nm(2) dr("实收金额") = dt1.Compute("Sum(实收金额)","客户名称 = \'" & nm(0) & "\'And [年] = \'" & nm(1) & "\'And [月] = \'" & nm(2) & "\'") dr("开票金额") = dt2.Compute("Sum(开票金额)","客户名称 = \'" & nv(0) & "\'And [年] = \'" & nv(1) & "\'And [月] = \'" & nv(2) & "\'") dr("开票税额") = dt2.Compute("Sum(开票税额)","客户名称 = \'" & nv(0) & "\'And [年] = \'" & nv(1) & "\'And [月] = \'" & nv(2) & "\'") dr("开票总额") = dt2.Compute("Sum(开票总额)","客户名称 = \'" & nv(0) & "\'And [年] = \'" & nv(1) & "\'And [月] = \'" & nv(2) & "\'") Next Next
|