重复了:
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("开piao金额") = dt2.Compute("Sum(开piao金额)","客户名称 = '" & nv(0) & "'And [年] = '" & nv(1) & "'And [月] = '" & nv(2) & "'")
dr("开piao税额") = dt2.Compute("Sum(开piao税额)","客户名称 = '" & nv(0) & "'And [年] = '" & nv(1) & "'And [月] = '" & nv(2) & "'")
dr("开piao总额") = dt2.Compute("Sum(开piao总额)","客户名称 = '" & nv(0) & "'And [年] = '" & nv(1) & "'And [月] = '" & nv(2) & "'")
Next
Next