Dim Filter1 As String = "1=1"
With e.Form.Controls("StartDate")
If .Value IsNot Nothing Then
If Filter1 >"" Then
Filter1 = Filter1 & " And "
End If
Filter1 = Filter1 & "来电时间 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("EndDate")
If .Value IsNot Nothing Then
If Filter1 >"" Then
Filter1 = Filter1 & " And "
End If
Filter1 = Filter1 & "来电时间 <= #" & .Value & "#"
End If
End With
Tables("管网管理所抢修热线").Filter = Filter1
Tables("用户管理水表热线").Filter = Filter1
Dim dt1 As fxDataSource
Dim a As New GroupTableBuilder("统计表1",DataTables("管网管理所抢修热线"))
a.filter = Tables("管网管理所抢修热线").Filter
a.Groups.AddDef("来电时间",DateGroupEnum.Year,"年")
a.Groups.AddDef("来电时间","月")
a.Groups.AddDef("来电时间",DateGroupEnum.Day,"日")
a.Totals.AddDef("来电信息",AggregateEnum.Count,"管网A单_接单数量") '对接单数量进行count
a.filter = Tables("管网管理所抢修热线").Filter & " and [是否解决] = True"
a.Totals.AddDef("是否解决",AggregateEnum.Count,"管网A单_已处理数量")'对已处理数量进行count
a.Totals.AddDef("是否解决",AggregateEnum.Count,"管网A单_未处理数量")
dt1 = a.BuildDataSource()
Dim dt2 As fxDataSource
Dim b As New GroupTableBuilder("统计表2",DataTables("用户管理水表热线"))
b.filter = Tables("用户管理水表热线").Filter
b.Groups.AddDef("来电时间",DateGroupEnum.Year,"年")
b.Groups.AddDef("来电时间","月")
b.Groups.AddDef("来电时间",DateGroupEnum.Day,"日")
b.Totals.AddDef("来电信息",AggregateEnum.Count,"表务B单_接单数量") '对数量进行count
b.Totals.AddDef("是否解决",AggregateEnum.Count,"表务B单_已处理数量")
b.Totals.AddDef("是否解决",AggregateEnum.Count,"表务B单_未处理数量")
dt2 = b.BuildDataSource()
Dim cls() As String = {"年","月","日"}
dt1.Combine(cls,dt2,cls)
dt1.Show("统计表bb")
MainTable = Tables("统计表bb")