Dim filter As String = "供应商简称 is not null"
Dim bd1 As New SQLGroupTableBuilder("统计表1","供应商")
bd1.Filter = filter
bd1.C
Dim dt1 As fxDataSource
bd1.Groups.AddDef("供应商简称")
bd1.Totals.AddDef("期初余额")
dt1 = bd1.BuildDataSource()
Dim bd2 As New SQLGroupTableBuilder("统计表2","入库单")
bd2.C
Dim dt2 As fxDataSource
bd2.Groups.AddDef("供应商简称")
bd2.Totals.AddDef("含税金额","入库金额")
bd2.Totals.AddExp("已对账金额","iif(申请单号 is null, 0, 含税金额)")
bd2.Totals.AddEXP("未对账金额","iif(申请单号 is null, 含税金额, 0)")
dt2 = bd2.BuildDataSource()
Dim bd3 As New SQLGroupTableBuilder("统计表3","流水账")
bd3.C
Dim dt3 As fxDataSource
bd3.Groups.AddDef("科目") 我想在这段代码加一个统计条件,科目= bd1里面的供应商简称才增加分组项,并不是所有的科目都会参与统计
bd3.Totals.AddDef("支出","付款金额")
dt3 = bd3.BuildDataSource()
dt1.Combine("供应商简称",dt2,"供应商简称")
dt1.Combine("供应商简称",dt3,"科目")
Tables("供应商列表_Table7").DataSource = dt1