日期:2014-05-17 浏览次数:20943 次
SELECT SUM(CASE WHEN isnumeric(amount) = 1 THEN cast(amount AS decimal(38, 2)) ELSE 0 END) FROM PQOrderLIN WHERE pqorderno = 'PQ1204007'
<% set rs=conn.exexute(sql) if not rs.EOF then response.write rs(0) end if %>
------解决方案--------------------
rs,sql都没有定义
<%
dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="SELECT SUM(CASE WHEN isnumeric(amount) = 1 THEN cast(amount AS decimal(38, 2))
ELSE 0 END) from PQOrderLin where PQorderNo='"&PQorderNo&"'"
set rs=conn.exexute(sql)
if not rs.EOF then
response.write rs(0)
end if
%>
------解决方案--------------------
带参 进去呀
PQorderNo="PQ1204007"
dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="SELECT SUM(CASE WHEN isnumeric(amount) = 1 THEN cast(amount AS decimal(38, 2))
ELSE 0 END) from PQOrderLin where PQorderNo='"&PQorderNo&"'"
set rs=conn.exexute(sql)
if not rs.EOF then
response.write rs(0)
end if
执行前 先放在 查询分析器里检查 是否有返回数据