Foxtable(狐表)用户栏目专家坐堂 → 降序怎么排?


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

主题:降序怎么排?

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


加好友 发短信
等级:四尾狐 帖子:972 积分:7048 威望:0 精华:0 注册:2013/3/31 10:33:00
降序怎么排?  发帖心情 Post By:2018/10/7 11:50:00 [只看该作者]

升序代码:
cmd.CommandText = "Sele ct top " & pagerows & " [_Identify], [_Identify] As 编号,[客户ID],[产品ID],[数量],[单价],[折扣] ,[数量]*[单价]*(1-[折扣]) as 金额 From {订单}  where "
If flt > "" Then
    cmd.CommandText &= iif(page=0,  "1=1 and " & flt ,  "[_Identify] not In (Sele ct top " & pagerows * page & " [_identify]  from {订单} where " & flt & " order by [_identify]) And " & flt & " order by [_Identify]")
Else
    cmd.CommandText &= iif(page=0,  "1=1" ,  "[_Identify] not In (Sele ct top " & pagerows * page & " [_identify]  from {订单}  order by [_identify]) order by [_Identify]")
End If

降序代码加上DESC:
cmd.CommandText = "Sele ct top " & pagerows & " [_Identify], [_Identify] As 编号,[客户ID],[产品ID],[数量],[单价],[折扣] ,[数量]*[单价]*(1-[折扣]) as 金额 From {订单}  where "
If flt > "" Then
    cmd.CommandText &= iif(page=0,  "1=1 and " & flt ,  "[_Identify] not In (Sele ct top " & pagerows * page & " [_identify]  from {订单} where " & flt & " order by [_identify] DESC) And " & flt & " order by [_Identify] DESC")
Else
    cmd.CommandText &= iif(page=0,  "1=1" ,  "[_Identify] not In (Sele ct top " & pagerows * page & " [_identify]  from {订单}  order by [_identify] DESC) order by [_Identify] DESC")
End If

结果打开第一页仍按升序排列,从第二页开始才正常按降序排列,怎么办?代码看不懂,不和怎么改


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


加好友 发短信
等级:四尾狐 帖子:972 积分:7048 威望:0 精华:0 注册:2013/3/31 10:33:00
  发帖心情 Post By:2018/10/7 11:52:00 [只看该作者]

就是说多出一个首页,怎么才能把这多余的首页去除?

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110629 积分:563047 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2018/10/7 12:01:00 [只看该作者]

降序代码加上DESC:
cmd.CommandText = "Sele ct top " & pagerows & " [_Identify], [_Identify] As 编号,[客户ID],[产品ID],[数量],[单价],[折扣] ,[数量]*[单价]*(1-[折扣]) as 金额 From {订单}  where "
If flt > "" Then
    cmd.CommandText &= iif(page=0,  "1=1 and " & flt &order by [_identify] DESC" ,  "[_Identify] not In (Sele ct top " & pagerows * page & " [_identify]  from {订单} where " & flt & " order by [_identify] DESC) And " & flt & " order by [_Identify] DESC")
Else
    cmd.CommandText &= iif(page=0,  "1=1 order by [_identify] DESC" ,  "[_Identify] not In (Sele ct top " & pagerows * page & " [_identify]  from {订单}  order by [_identify] DESC) order by [_Identify] DESC")
End If

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


加好友 发短信
等级:四尾狐 帖子:972 积分:7048 威望:0 精华:0 注册:2013/3/31 10:33:00
  发帖心情 Post By:2018/10/7 14:02:00 [只看该作者]

OK!可以上线试用了,谢谢蓝版

 回到顶部