access排序问题

hjl5135 2007-02-06 09:05:24
SELECT a.FileType, format(sum(a.SheetsPrinted),'0') as PagesPrinted, format(sum(a.Copies),'0') as Copies, Cdbl(format(su(a.TotalCost),'0.00')) as TotalCost FROM prtlog a WHERE a.SiteName='localhost' and a.SubmitTime BETWEEN #2003-01-01 00:00:00# AND #2007-02-06 23:59:59# and a.SheetsPrinted > 0 GROUP by a.FileType order by 'Copies' desc


我想把求和后的结果按指定的列排序,就是Copies,但是有问题,排不了
问题在于order by 'Copies' desc ,请各位指教,谢谢!!!
问题解决,马上给分,信誉第一,从不拖欠。
...全文
427 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
hjl5135 2007-02-16
  • 打赏
  • 举报
回复
各位朋友,最近CSDN给分页面出现脚本错误,暂时给不了分,正常了马上揭帖,谢谢大家了。
sunnychu 2007-02-07
  • 打赏
  • 举报
回复
order by val(copies)
OracleRoob 2007-02-07
  • 打赏
  • 举报
回复
SELECT a.FileType, format(sum(a.SheetsPrinted),'0') as PagesPrinted, format(sum(a.Copies),'0') as Copies, Cdbl(format(su(a.TotalCost),'0.00')) as TotalCost
FROM prtlog a
WHERE a.SiteName='localhost'
and a.SubmitTime BETWEEN #2003-01-01 00:00:00# AND #2007-02-06 23:59:59#
and a.SheetsPrinted > 0
GROUP by a.FileType
order by format(sum(a.Copies),'0') desc
wwwwb 2007-02-07
  • 打赏
  • 举报
回复
order by 3
cyb1017 2007-02-07
  • 打赏
  • 举报
回复
SELECT a.FileType, format(sum(a.SheetsPrinted),'0') as PagesPrinted, format(sum(a.Copies),'0') as Copies, Cdbl(format(su(a.TotalCost),'0.00')) as TotalCost FROM prtlog a WHERE a.SiteName='localhost' and a.SubmitTime BETWEEN #2003-01-01 00:00:00# AND #2007-02-06 23:59:59# and a.SheetsPrinted > 0 GROUP by a.FileType order by sum(a.Copies) desc
OracleRoob 2007-02-07
  • 打赏
  • 举报
回复
不建议用列所在的顺序来排序,维护起来比较困难。
OracleRoob 2007-02-07
  • 打赏
  • 举报
回复
直接用原来的串排序即可。

7,713

社区成员

发帖
与我相关
我的任务
社区描述
Microsoft Office Access是由微软发布的关系数据库管理系统。它结合了 MicrosoftJet Database Engine 和 图形用户界面两项特点。
社区管理员
  • Access
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧