asp+access 怎么让两个SUM在一条语句中

ddd0301 2013-08-19 11:03:30
我这样可以吗?
"select SUM("&xrs("dd")&") as count1 SUM("&xrs("ee")&") as count2 from content where code="&rs("code")&""

为什么显示不出来呢?
...全文
133 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
提示什么错误呢? 没错误的话就输出那语句看什么字符串
街头小贩 2013-08-19
  • 打赏
  • 举报
回复
版主不是说少了个逗号吗
dim SQL:SQL="select SUM("&xrs("dd")&") as count1,SUM("&xrs("ee")&") as count2 from content where code='"&rs("code")&"'"
response.write wrs("count1") 这样输出的是结果集中的count1列值 但用<%= count1%>就不可以.这是为什么呢 这样输出是是变量count1的值
ddd0301 2013-08-19
  • 打赏
  • 举报
回复
引用 2 楼 xiaofanku 的回复:
dim SQL:SQL="select SUM("&xrs("dd")&") as count1  SUM("&xrs("ee")&") as count2 from content where code='"&rs("code")&"'"
也没有显示...另外一点我用 response.write wrs("count1") 可以显示出来但用<%= count1%>就不可以.这是为什么呢?
ddd0301 2013-08-19
  • 打赏
  • 举报
回复
引用 1 楼 chinmo 的回复:
[quote=引用 楼主 ddd0301 的回复:] 我这样可以吗? "select SUM("&xrs("dd")&") as count1 SUM("&xrs("ee")&") as count2 from content where code="&rs("code")&"" 为什么显示不出来呢?
"select SUM("&xrs("dd")&") as count1,SUM("&xrs("ee")&") as count2 from content where code="&rs("code")&"" 在中间加逗号[/quote] 逗号加过了 还是不行...
街头小贩 2013-08-19
  • 打赏
  • 举报
回复
dim SQL:SQL="select SUM("&xrs("dd")&") as count1  SUM("&xrs("ee")&") as count2 from content where code='"&rs("code")&"'"
  • 打赏
  • 举报
回复
引用 楼主 ddd0301 的回复:
我这样可以吗? "select SUM("&xrs("dd")&") as count1 SUM("&xrs("ee")&") as count2 from content where code="&rs("code")&"" 为什么显示不出来呢?
"select SUM("&xrs("dd")&") as count1,SUM("&xrs("ee")&") as count2 from content where code="&rs("code")&"" 在中间加逗号
ddd0301 2013-08-19
  • 打赏
  • 举报
回复
引用 5 楼 xiaofanku 的回复:
版主不是说少了个逗号吗
dim SQL:SQL="select SUM("&xrs("dd")&") as count1,SUM("&xrs("ee")&") as count2 from content where code='"&rs("code")&"'"
response.write wrs("count1") 这样输出的是结果集中的count1列值 但用<%= count1%>就不可以.这是为什么呢 这样输出是是变量count1的值
找到错误了,非常感谢提醒,是我表有问题,现在修改好了
ddd0301 2013-08-19
  • 打赏
  • 举报
回复
引用 6 楼 chinmo 的回复:
提示什么错误呢? 没错误的话就输出那语句看什么字符串
找到错误了,非常感谢提醒,是我表有问题,现在修改好了

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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