窗口筛选中如何加入交叉查询?比如我想在表达式中加入如下查询命令,该怎么办?
想加入的交叉查询
Dim g As New CrossTableBuilder("统计表1", DataTables("2012年数据"))
g.Caption = "下属企业经营情况"
g.HGroups.AddDef("下属企业")
g.VGroups.AddDef("经营范围")
g.Totals.AddDef("项目编号", AggregateEnum.Count, "项目编号")
g.HorizontalTotal = True
g.VerticalTotal = True
g.Build()
MainTable = Tables("统计表1")
现有的表达式
Dim Filter As
String
With e.Form.Controls("StartDate")
If .Value IsNot Nothing
Then
If Filter >"" Then
Filter = Filter & " And "
End
If
Filter = Filter & "日期 >= #" & .Value & "#"
End
If
End
With
With e.Form.Controls("EndDate")
If .Value IsNot Nothing
Then
If Filter >"" Then
Filter = Filter & " And "
End
If
Filter = Filter & "日期 <= #" & .Value & "#"
End
If
End
With
If Filter > "" Then
Tables("2012年数据").Filter = Filter
End
If
[此贴子已经被作者于2012-6-13 16:06:41编辑过]