Dim b As New SQLGroupTableBuilder("统计表1","门市客户信息")
b.C
b.Groups.AddDef("客户区域") '根据客户区域分组
b.Totals.AddDef("客户编号",AggregateEnum.Count,"进店客户量")
b.Totals.AddExp("转入订单","转入订单*-1","转入订单量",AggregateEnum.Sum)
b.Totals.AddExp("价值跟单","价值跟单*-1","价值跟单量",AggregateEnum.Sum)
b.VerticalTotal = True
b.Build '生成统计表
DataTables("统计表1").DataCols.Add("订单率",Gettype(String),"转入订单量 / 进店客户量")
DataTables("统计表1").DataCols("订单率").SetFormat("#0.00%")
MainTable = Tables("统计表1") '打开生成的统计表