sql查询用到变量的问题
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计较, 请问应该怎么修改,谢谢!
[解决办法]
ght是个变量吗
sql1 = "select cubage from data_tcubage where tank='"+rs("names")+"'and high='"&ght&"' "