查询语句报语法错误

duizhang22 2009-07-13 08:45:27
select GO_Oper_NO as 操作卡号,count(*) as 临时卡A,sum(M_money) as 临时卡A收费 from (select * from GoCar where Go_Date>='" & Format(DTPicker4.Value, "yyyy-MM-dd HH:mm:ss") & "' and Go_Date<='" & Format(DTPicker5.Value, "yyyy-MM-dd HH:mm:ss") & "') group by GO_Oper_NO order by GO_Oper_NO

查询语句在上面了,用了一个子查询作为派生的表,不知道哪里有错,请高手帮忙看看
...全文
14 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
饮水需思源 2009-07-13
  • 打赏
  • 举报
回复
from 后的子查询语句要用 as 别名 作为临时表来处理
duizhang22 2009-07-13
  • 打赏
  • 举报
回复
真的好了哎~~
不过加个as tmp 是什么意思啊
放心,分肯定给了
饮水需思源 2009-07-13
  • 打赏
  • 举报
回复
select GO_Oper_NO as 操作卡号,count(*) as 临时卡A,sum(M_money) as 临时卡A收费 from (select * from GoCar where Go_Date>='" & Format(DTPicker4.Value, "yyyy-MM-dd HH:mm:ss") & "' and Go_Date <='" & Format(DTPicker5.Value, "yyyy-MM-dd HH:mm:ss") & "') as tmp group by GO_Oper_NO order by GO_Oper_NO

1,216

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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