Dim b As New SQLGroupTableBuilder("统计表1","园区")
b.C
b.AddTable("园区","园区名称","施肥记录","园区名称",JoinModeEnum.Left) '添加统计表
b.AddTable("园区","园区名称","灌溉记录","园区名称",JoinModeEnum.Left) '添加统计表
b.AddTable("园区","园区名称","土壤耕作记录","园区名称",JoinModeEnum.Left) '添加统计表
b.AddTable("园区","园区名称","剪枝记录","园区名称",JoinModeEnum.Left) '添加统计表
b.Groups.AddDef("{园区}.园区名称")
b.Totals.AddDef("{施肥记录}.实际施肥量","施肥量(千克)") '统计值偏大
b.Totals.AddDef("{灌溉记录}.实际灌溉量","灌溉量(立方米)")
b.Totals.AddDef("{施肥记录}.编号", AggregateEnum.Count, "施肥次数(次)") '统计值偏大
b.Totals.AddDef("{灌溉记录}.编号", AggregateEnum.Count, "灌溉次数(次)") '统计值偏大
b.Totals.AddDef("{土壤耕作记录}.编号", AggregateEnum.Count,"耕作次数(次)") '统计值偏大
b.Totals.AddDef("{剪枝记录}.编号", AggregateEnum.Count, "剪枝次数(次)") '统计值偏大
b.Subtotal = True '生成汇总模式
b.Build
MainTable=Tables("统计表1")