• 主页

# 如何判断当rs为空时 不加入计算表达式？

kkk444dsfsa 2010-07-21 03:07:38
dim dcml,zyf,hkze,zzzfy,zqitafy
dcml = 0
zyf = 0
hkze = 0
zzzfy= 0
zqitafy = 0

if not isnull(rs("zyf")) then zyf = cdbl(rs("zyf"))
if not isnull(rs("clyf")) then clyf =cdbl(rs("clyf"))
if not isnull(rs("hkze")) then hkze = cdbl(rs("hkze"))
if not isnull(rs("zzzfy")) then zzzfy = cdbl(rs("zzzfy"))
if not isnull(rs("zqitafy")) then zqitafy = cdbl(rs("zqitafy"))

dcml = zyf - clyf - hkze - zzzfy - zqitafy

...全文
130 点赞 收藏 12

12 条回复

kkk444dsfsa 2010-07-22
[Quote=引用 11 楼 chinmo 的回复:]
zyf = rs("zyf")& "" : if zyf ="" then zyf = 0
clyf = rs("clyf") & "" :if clyf ="" then clyf = 0
hkze = rs("hkze") & "" :if hkze ="" then hkze = 0
zzzfy = rs("zzzfy") & "" :if zzzfy ……
[/Quote]

zyf = rs("zyf")& "" : if zyf ="" then zyf = 0
clyf = rs("clyf") & "" :if clyf ="" then clyf = 0
hkze = rs("hkze") & "" :if hkze ="" then hkze = 0
zzzfy = rs("zzzfy") & "" :if zzzfy ="" then zzzfy =0
zqitafy = rs("zqitafy") &"" : if zqitafy ="" then zqitafy = 0

dcml = zyf - clyf - hkze - zzzfy - zqitafy

``````zyf=trim(rs("zyf")) : if zyf="" then zyf = 0
clyf =trim(rs("clyf ")) : if clyf ="" then clyf = 0
hkze=trim(rs("hkze")) : if hkze="" then hkze= 0
zzzfy=rs("zzzfy") : if zzzfy="" then zzzfy= 0
zqitafy=trim(rs("zqitafy")) : if zqitafy="" then zqitafy= 0

dcml = zyf - clyf - hkze - zzzfy - zqitafy``````

kkk444dsfsa 2010-07-21

kkk444dsfsa 2010-07-21
<%
dim dcml,zyf,hkze,zzzfy,zqitafy
dcml = 0

'if not isnull(rs("jianshu")) then hjjs =hjjs + cdbl(rs("jianshu"))

zyf = rs("zyf")& "" : if zyf ="" then zyf = 0
clyf = rs("clyf") & "" :if clyf ="" then clyf = 0
hkze = rs("hkze") & "" :if hkze ="" then hkze = 0
zzzfy = rs("zzzfy") & "" :if zzzfy ="" then zzzfy =0
zqitafy = rs("zqitafy") &"" : if zqitafy ="" then zqitafy = 0

dcml = zyf - clyf - hkze - zzzfy - zqitafy

dim curpage, i
if request("page")="" then
curpage = 1
else
curpage = clng(request("page"))
end if
rs.pagesize = 100000
rs.absolutepage = curpage
for i = 1 to rs.pagesize
%>
<tr onMouseOver="bgColor='#4474bb'" onMouseOut="bgColor='#ffffff'" onDblClick="javascript:window.open('../baobiao/fhqdshxx.asp?fhqdbh=<%=base64Encode(rs("fhqdh"))%>&companyid=<%=base64Encode(newcompanyid)%>','发货清单详细信息','directorys=no,toolbars=no,status=no,menubars=no,scrollbars=yes,resizeable=no,width=1000,height=600,top='+(window.screen.height-600)/2+',left='+(window.screen.width-1000)/2+'');">
<td width="99" height="20"><div align="center"><%=rs("fhqdh")%></div></td>
<td width="89" ><div align="center"><%=rs("kcsj")%></div></td>
<td width="61"><div align="center"><%=rs("fgsbm")%></div></td>
<td width="71"><div align="center"><%=rs("zdzbm") %></div></td>
<td width="80"><div align="center"><%=rs("clbh")%></div></td>
<td width="96"><div align="center"><%=rs("zyf")%></div></td>
<td width="71"><div align="center"><%=rs("clyf")%></div></td>
<td width="80"><div align="center"><%=rs("hkze")%></div></td>
<td width="65"><div align="center"><%=rs("zzzfy")%></div></td>
<td width="84"><div align="center"><%=rs("zqitafy")%></div></td>
<td width="133"><div align="center"><font color="#FF0000"><%=dcml%></font></div></td>
</tr>

<% rs.movenext
if rs.eof then
i = i + 1
exit for
end if
next
%>

SNOYC 2010-07-21

kkk444dsfsa 2010-07-21

toury 2010-07-21
zyf=rs("zyf")&"" : if zyf="" then zyf = 0
clyf =rs("clyf ")&"" : if clyf ="" then clyf = 0
hkze=rs("hkze")&"" : if hkze="" then hkze= 0
zzzfy=rs("zzzfy")&"" : if zzzfy="" then zzzfy= 0
zqitafy=rs("zqitafy")&"": if zqitafy="" then zqitafy= 0

dcml = zyf - clyf - hkze - zzzfy - zqitafy

kkk444dsfsa 2010-07-21
if not isnull(rs("zyf")) and rs("zyf") <>"" then zyf = cdbl(rs("zyf"))
if not isnull(rs("clyf")) and rs("clyf") <>"" then clyf =cdbl(rs("clyf"))
if not isnull(rs("hkze")) and rs("hkze") <>"" then hkze = cdbl(rs("hkze"))
if not isnull(rs("zzzfy")) and rs("zzzfy") <>"" then zzzfy = cdbl(rs("zzzfy"))
if not isnull(rs("zqitafy")) and rs("zqitafy") <>"" then zqitafy = cdbl(rs("zqitafy"))
dcml = zyf - clyf - hkze - zzzfy - zqitafy

chinaczb2001 2010-07-21

lzp4881 2010-07-21

ASP

2.8w+

ASP即Active Server Pages，是Microsoft公司开发的服务器端脚本环境。