肯定是生成的表达式有误,这么测试一下看看:
Dim qssj As Date = e.Form.Controls("起始时间").Value
Dim jssj As Date = e.Form.Controls("结束时间").Value
Dim g As New SQLGroupTableBuilder("统计表2", "出库明细")
Dim dt1 As fxDataSource
g.Groups.AddExp("年", "Year(财务日期)")
g.Groups.AddDef("财务日期","月")
g.Groups.AddDef("出库单编号")
g.Groups.AddDef("商品代码")
g.Totals.AddDef("数量")
g.Totals.AddExp("金额","数量*促销价")
g.Filter = "{出库明细}.财务日期 >= #" & qssj & "# And {出库明细}.财务日期 <= #" & jssj & "#"
Messagebox.Show(g.Filter)
g.FromServer = True
dt1 = g.BuildDataSource()
Tables("销售分析_Table1").DataSource = dt1
此外,如果你的数据源是SQL Server,记得日期用单引号括起来,而不是#