access数据库,还是sqlserver数据库。
sqlserver这样写
Dim g As New SQLCrossTableBuilder("统计表1", "加油明细表")
g.HGroups.AddDef("车型")
g.HGroups.AddDef("牌照号")
g.VGroups.AddExp("年","Year(case when Day(日期)> 25 then DateAdd(d,6,日期) else 日期 end)")
g.VGroups.AddExp("月","Month(case when Day(日期)> 25 then DateAdd(d,6,日期) else 日期 end)")
g.Totals.AddDef("数量", "数量")
g.Build()
MainTable = Tables("统计表1")