Dim b As New SQLGroupTableBuilder("流量","XJ")
b.C
b.Groups.AddDef("序号") '
b.Groups.AddDef("日期",DateGroupEnum.None)
b.Groups.AddDef("年份")
b.Groups.AddDef("月份")
b.Groups.AddDef("部门名称")
b.Groups.AddDef("摘要")
b.Groups.AddDef("现金流量项目编码")
b.Groups.AddDef("银行账户")
b.Totals.AddDef("收入金额")
b.Totals.AddDef("支出金额")
b.Filter = "年份=" & N1 & " and 月份 = " & Y1 & ""
b.Build
Dim Vals As List(of String())
Vals = DataTables("流量").GetValues("序号|日期|年份|月份|部门名称|摘要|现金流量项目编码|银行账户|收入金额|支出金额")
For i As Integer = 0 To Vals.Count - 1
Dim dr1 As DataRow
dr1 = DataTables("现金流量明细账").SQLFind("序号= '" & Vals(i)(0) & "' And 日期= '" & Vals(i)(1) & "' And 年份= '" & Vals(i)(2) & "' And 月份= '" & Vals(i)(3) & "' And 部门= '" & Vals(i)(4) & "' And 摘要= '" & Vals(i)(5) & "' And 现金流量项目编号= '" & Vals(i)(6) & "' And 银行账户= '" & Vals(i)(7) & "' And 收入金额= '" & Vals(i)(8) & "' And 支出金额= '" & Vals(i)(9) & "'")
If dr1 Is Nothing Then
Dim dr As DataRow = DataTables("现金流量明细账").AddNew()
dr("序号") = Vals(i)(0)
dr("日期") = Vals(i)(1)
dr("年份") = Vals(i)(2)
dr("月份") = Vals(i)(3)
dr("部门") = Vals(i)(4)
dr("摘要") = Vals(i)(5)
dr("现金流量项目编号") = Vals(i)(6)
dr("银行账户") = Vals(i)(7)
dr("收入金额") = Vals(i)(8)
dr("支出金额") = Vals(i)(9)
End If
Next
发现还是会重复,不知哪里问题