为什么isnull()不行呢?急———————在线等
MH2o 2002-12-09 02:24:26 小弟有个问题!!!请看代码:
<%
strsql = "select CDVCID from TDevice where cdvcname = '1#皮带'"
set rstemp=obBaseConnect.execute(strsql)
%>
<%do while not rstemp.eof%>
<%onevalue = rstemp(0).value %>
<%
rstemp.movenext
loop
%>
<%
strsql = "select CAccumulation from TAccumulate where CDVCID = '"&onevalue&"' and CDuraID = '2' and CAccuTypeID = 'Trape' and CAccuDate = '"&dtemp&"'"
set temp=obBaseConnect.execute(strsql)
do while not temp.eof
onetmvalue = temp(0).value
%>
<% If isnull(onetmvalue) then onetmvalue=0 end if%>
<%=onetmvalue%><p></p>
<%
temp.movenext
loop
%>
我的想法是,如果onetmvalue是空的话(从数据库中取得)就赋它为0!
可为什么最后(onetmvalue为空时)onetmvalue不显示呢?并不显示onetmvalue=0???