以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  代码太长,晕头转向  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=125457)

--  作者:石四
--  发布时间:2018/9/28 15:26:00
--  代码太长,晕头转向
参照http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=107839
要运用的实例没有类似“订单编号”这一列,list函数的代码几公里长,不知从哪里下手改造下面的代码
cmd.CommandText = "Select Top " & pagerows & " *,(数量*单价) As 金额 from (Select [_identify]  as 订单编号,日期,客户,(Select sum(数量)  from {订单} where 订单编号={订单}.订单编号) As 数量,单价,产品 From {订单}) A where "
If flt > "" Then
    cmd.CommandText &= iif(page=0,  "1=1 and " & flt ,  "[订单编号] not In (Select top " & pagerows * page & " [_identify]  from {订单}  order by [_identify]) and " & flt & " order by [订单编号]")
Else
    cmd.CommandText &= iif(page=0,  "1=1" ,  "[订单编号] not In (Select top " & pagerows * page & " [_identify]  from {订单}  order by [_identify]) order by [订单编号]")
End If

图片点击可在新窗口打开查看

--  作者:有点甜
--  发布时间:2018/9/28 15:33:00
--  
把【订单编号】列改成你表格的编号列或者主键列即可。