Dim Filter1 As String
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
If Filter1 > "" Then
Tables("管网管理所抢修热线").Filter = Filter1
End If
Dim Filter2 As String
With e.Form.Controls("StartDate")
If .Value IsNot Nothing Then
If Filter2 >"" Then
Filter2 = Filter2 & " And "
End If
Filter2 = Filter2 & "来电时间 >= #" & .Value & "#"
End If
End With
With e.Form.Controls("EndDate")
If .Value IsNot Nothing Then
If Filter2 >"" Then
Filter2 = Filter2 & " And "
End If
Filter2 = Filter2 & "来电时间 <= #" & .Value & "#"
End If
End With
If Filter1 > "" Then
Tables("用户管理水表热线").Filter = Filter2
End If
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单") '对数量进行统计
a.Build '生成统计表
Dim b As New GroupTableBuilder("统计表1",DataTables("用户管理水表热线"))
b.filter = Tables("用户管理水表热线").Filter
b.Groups.AddDef("来电时间",DateGroupEnum.Year,"年")
b.Groups.AddDef("来电时间","月")
b.Groups.AddDef("来电时间",DateGroupEnum.Day,"日")
b.Totals.AddDef("来电信息",AggregateEnum.Count,"接单数量_表务B单") '对数量进行统计
b.Build '生成统计表
MainTable = Tables("统计表1") '打开生成的统计表