大家给我看看这段sql语句为什么不对?

sxzkf 2006-05-29 03:01:17
下面这段代码测试通不过:

sql="select sum(precipitation) as p from tabtimedata where isnumeric(precipitation)=1 and stationnum =57036 and observtimes between 2006042006 and 2006042012"

但是下面这段时可以的:


sql="select precipitation from tabtimedata where isnumeric(precipitation)=1 and stationnum =57036 and observtimes between 2006042006 and 2006042012"

谢谢
...全文
95 2 打赏 收藏 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
cqq 2006-05-29
  • 打赏
  • 举报
回复
看看错误信息,


sum(Cast(precipitation as int))
jinfeng003 2006-05-29
  • 打赏
  • 举报
回复
precipitation 字段会不会不是数值类型?

28,402

社区成员

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

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