升序代码: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
结果打开第一页仍按升序排列,从第二页开始才正常按降序排列,怎么办?代码看不懂,不和怎么改