Dim tjb As String = "统计表1"
Dim b As New SQLGroupTableBuilder(tjb,"管网管理所抢修热线")
b.Groups.AddExp("来电时间","CDate(日期)")
b.Totals.AddExp("表A_接单量","1")
b.Totals.AddExp("表A_已处理数量","iif(是否解决=true,1,0)")
b.Totals.AddExp("表A_未处理数量","iif(是否解决=true,0,1)")
Dim dd As Date = "2018-10-01"
b.filter = "来电时间>=#" & dd & "# and 来电时间 < #" & dd.addmonths(1) & "#"
'b.Build
Dim d As fxDataSource = b.BuildDataSource()
Dim bms As String = "用户管理水表热线|公司内部业务热线登记表|咨询业务热线登记表"
For Each bm As String In bms.split("|")
Dim b1 As New SQLGroupTableBuilder(tjb,bm)
b1.Groups.AddExp("来电时间","CDate(日期)")
b1.Totals.AddExp(bm & "_接单量","1")
b1.Totals.AddExp(bm & "_已处理数量","iif(是否解决=true,1,0)")
b1.Totals.AddExp(bm & "_未处理数量","iif(是否解决=true,0,1)")
b.filter = "来电时间>=#" & dd & "# and 来电时间 < #" & dd.addmonths(1) & "#"
'b1.Build
Dim d1 As fxDataSource = b1.BuildDataSource()
d.Combine("来电时间",d1,"来电时间")
Next
d.Show(tjb)
MainTable = Tables(tjb) '打开生成的统计表"