asp二重查询的问题

jsrg1234567 2010-02-23 12:35:20

ght=cint(rs("levevale")*1000)

Set conn1=Server.CreateObject("ADODB.CONNECTION")
HJSTRCONN1="Provider=MSDAORA;Data Source=*;User ID=*;Password=*"
conn1.Open HjStrConn1
sql1 = "select cubage from data_tcubage where tank='"+rs("names")+"'and high='"+ght+"' "
set rs1=conn.execute(SQL1)
<%=rs1("cubage")%>
以上语句查询不到结果,没有数值显示,但把 high='"+ght+"换成high=1000就会有数据出来rs("levevale")是带3位小数的数值,例如4.567,现在要把它乘以1000让它和high计较, 请问应该怎么修改,谢谢!
...全文
72 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
wanxin2199 2010-02-23
  • 打赏
  • 举报
回复
response.write rs("levevale")
response.end
检查结果是不是为空
jsrg1234567 2010-02-23
  • 打赏
  • 举报
回复
ght=rs("levevale")*1000

Set conn1=Server.CreateObject("ADODB.CONNECTION")
HJSTRCONN1="Provider=MSDAORA;Data Source=*;User ID=*;Password=*"
conn1.Open HjStrConn1
sql1 = "select cubage from data_tcubage where tank='"+rs("names")+"'and high= " & ght
set rs1=conn.execute(SQL1)
<%=rs1("cubage")%>
以上语句查询不到结果,没有数值显示,但把 ght=rs("levevale")*1000 换成ght=1000 就会有数据出来rs("levevale")是带3位小数的数值,例如4.567,现在要把它乘以1000让它和high计较, 请问应该怎么修改,谢谢!
jsrg1234567 2010-02-23
  • 打赏
  • 举报
回复
帮帮忙,各位大哥,谢谢
gxq323 2010-02-23
  • 打赏
  • 举报
回复
看错了,ght是数字类型吧,high='"+ght+"'改成high="+ght+"
gxq323 2010-02-23
  • 打赏
  • 举报
回复
ght里面是否有空格,你把他replace掉试试
孟子E章 2010-02-23
  • 打赏
  • 举报
回复
sql1 = "select cubage from data_tcubage where tank='"+rs("names")+"'and high="+ght

or

sql1 = "select cubage from data_tcubage where tank='"+rs("names")+"'and high>"+ght

28,391

社区成员

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

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