如何只统计-本年,当月(本月),本周,本日的数据?
下面代码,是统计所有数据的年,月等?
Dim b As New CrossTableBuilder("统计表1", DataTables("订单"))
b.HGroups.AddDef("客户") '
b.HGroups.AddDef("产品") '
b.VGroups.AddDef("日期", DateGroupEnum.Year, "{0}年") '
b.VGroups.AddDef("日期", "{0}月") '
b.Totals.AddDef("数量", "数量") '
b.Totals.AddDef("金额", "金额") '
'b.Build '
参考:
http://www.foxtable.com/webhelp/topics/2720.htm
……
b.Totals.AddDef("金额", "金额")
b.filter = "日期 >= #" & dt1 & "# And 日期 <= #" & dt2 & "#"
b.Build