Foxtable(狐表)用户栏目专家坐堂 → 代码太长,晕头转向


  共有2437人关注过本帖树形打印复制链接

主题:代码太长,晕头转向

帅哥哟,离线,有人找我吗?
石四
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:972 积分:7048 威望:0 精华:0 注册:2013/3/31 10:33:00
代码太长,晕头转向  发帖心情 Post By: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

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

 回到顶部