内置加载树的分页问题
在窗口中插入一个LoadTree控件和一个表控件
表的select语句为 sele ct * fr om {销售查看表} where 1=2
是个视图,创建代码为
CR EATE VIEW 销售查看表
AS
SE LECT 单号,日期,a.条码,商品,尺寸,数量,标准价,(Case when 数量= 0 Or 标准价=0 Then 0 Else Round(成交金额/ (数量*标准价),2 ) End) As 折扣,成交金额,业务员,店铺,\'太平鸟女装\' as 品牌 F rom {太平鸟女装销售记录表} As a INNER JOIN {太平鸟女装商品表} As b ON a.条码= b.条码 union all
Sel ect 单号,日期,a.条码,商品,尺寸,数量,标准价,(Case when 数量= 0 Or 标准价=0 Then 0 Else Round(成交金额/ (数量*标准价),2 ) End) As 折扣,成交金额,业务员,店铺,\'太平鸟男装\' as 品牌 F rom {太平鸟男装销售记录表} As a INNER JOIN {太平鸟男装商品表} As b ON a.条码= b.条码
窗口另加一个按钮控件, 代码为
Dim DTP1 As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker1")
Dim DTP2 As WinForm.DateTimePicker = e.Form.Controls("DateTimePicker2")
Dim NC1 As WinForm.NumericComboBox = e.Form.Controls("NumericComboBox1")
Dim d1 As Date = DTP1.Value \'开始日期
Dim d2 As Date = DTP2.Value \'终止日期
Dim hs As Integer = NC1.Value \'加载行数
Dim T1 As Table = e.Form.Controls("Table1").Table
Dim trv As WinForm.LoadTree = e.F orm.Controls("LoadTree1")
trv.Build(T1,"日期 YMD|单号", hs, "日期 >= \'" & d1 & "\' and 日期 <= \'" & d2 & "\' and 店铺 = \'" & User.Name & "\'")
由于数据来自于两个表,分页有问题
请问如何改写创建视图代码以解决分页问题?