以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  请教,统计数据,提示不再支持“Null”常量;请改用“System.DBNull”  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=123135)

--  作者:bahamute
--  发布时间:2018/8/8 17:09:00
--  请教,统计数据,提示不再支持“Null”常量;请改用“System.DBNull”

错误代码:编译错误:未声明“null”。不再支持“Null”常量;请改用“System.DBNull”

dr("人数_总人数") = iif((DataTables("基本信息"). SQLCompute("Count(姓名)","[单位] = \'" & dr("单位") & "\'"))=0,null,DataTables("基本信息"). SQLCompute("Count(姓名)","[单位] = \'" & dr("单位") & "\'"))

--  作者:有点甜
--  发布时间:2018/8/8 17:13:00
--  

null改成nothing

 

不建议你使用iif函数,此函数,两个表达式都会计算的,效率不高,还容易出错。