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 dt1 As fxDataSource
Dim a As New GroupTableBuilder("统计表1",DataTables("管网管理所抢修热线"))
a.filter = Tables("管网管理所抢修热线").Filter
a.Groups.AddDef("来电时间",DateGroupEnum.None)
a.Totals.AddDef("来电信息",AggregateEnum.Count,"接单数量_管网A单") '对接单数量进行count
a.Totals.AddDef("是否解决",AggregateEnum.Count,"已处理数量_管网A单") '对接单数量进行count
dt1 = a.BuildDataSource()
Dim dt2 As fxDataSource
Dim b As New GroupTableBuilder("统计表2",DataTables("用户管理水表热线"))
b.filter = Tables("用户管理水表热线").Filter
b.Groups.AddDef("来电时间",DateGroupEnum.None)
b.Totals.AddDef("来电信息",AggregateEnum.Count,"接单数量_表务B单") '对数量进行统计
dt2 = b.BuildDataSource()
dt1.Combine("来电时间",dt2,"来电时间")
dt1.Show("统计表1")