若是rs(0) 为空,我该如何给它赋一个默认值呢
因为以后的处理中要对他进行除法操作,所以不能为零或是空,
请将具体语句写出来,呵呵,谢谢
6 个解决方案
#1
你的前台是VB或ASP吧?
这样写
if rs.eof=true then rs(0)="默认值"
好久没用VB了,应该是这样写的。记不太清楚了
这样写
if rs.eof=true then rs(0)="默认值"
好久没用VB了,应该是这样写的。记不太清楚了
#2
sql1="select (case isnull(sum(overall_time004/60),1) when 0 then 1 end) from office_ue_gzwd004 where item_id004='" & item_id004& "' and publisher004 like '" & total(1,0) & "'"
#3
sql1="select sum(case when overall_time004/60 is null then 0 else 1 end) from office_ue_gzwd004 where item_id004='" & item_id004& "' and publisher004 like '" & total(1,0) & "'"
#4
是的 ,我的前台是asp
谢谢,我试一下先
谢谢,我试一下先
#5
设置默认值為0
sql1="select isnull(sum(overall_time004/60),0) from office_ue_gzwd004 where item_id004='" & item_id004& "' and publisher004 like '" & total(1,0) & "'"
sql1="select isnull(sum(overall_time004/60),0) from office_ue_gzwd004 where item_id004='" & item_id004& "' and publisher004 like '" & total(1,0) & "'"
#6
搞定,谢谢各位大大的热情帮助
#1
你的前台是VB或ASP吧?
这样写
if rs.eof=true then rs(0)="默认值"
好久没用VB了,应该是这样写的。记不太清楚了
这样写
if rs.eof=true then rs(0)="默认值"
好久没用VB了,应该是这样写的。记不太清楚了
#2
sql1="select (case isnull(sum(overall_time004/60),1) when 0 then 1 end) from office_ue_gzwd004 where item_id004='" & item_id004& "' and publisher004 like '" & total(1,0) & "'"
#3
sql1="select sum(case when overall_time004/60 is null then 0 else 1 end) from office_ue_gzwd004 where item_id004='" & item_id004& "' and publisher004 like '" & total(1,0) & "'"
#4
是的 ,我的前台是asp
谢谢,我试一下先
谢谢,我试一下先
#5
设置默认值為0
sql1="select isnull(sum(overall_time004/60),0) from office_ue_gzwd004 where item_id004='" & item_id004& "' and publisher004 like '" & total(1,0) & "'"
sql1="select isnull(sum(overall_time004/60),0) from office_ue_gzwd004 where item_id004='" & item_id004& "' and publisher004 like '" & total(1,0) & "'"
#6
搞定,谢谢各位大大的热情帮助