以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]表达式列为0时,不显示0,如何解决  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=28754)

--  作者:hrw68529
--  发布时间:2013/2/17 15:42:00
--  [求助]表达式列为0时,不显示0,如何解决
表达式列为0时,不显示0,如何设置
--  作者:lin_hailun
--  发布时间:2013/2/17 16:01:00
--  
 在原本的基础上加入一个判断

 IIF( 原来的表达式 = 0, null, 原来的表达式)

--  作者:hrw68529
--  发布时间:2013/2/17 16:26:00
--  
谢谢,如果是在表属性里写的程序,怎么加入,如下边代码

Select Case e.DataCol.Name
    Case "单位代码"
        e.DataRow("转任") = DataTables("人员增减").Compute("Count(_Identify)", "进入渠道 = 1 And 单位代码 = " & e.DataRow("单位代码"))
        e.DataRow("调任") = DataTables("人员增减").Compute("Count(_Identify)", "进入渠道 = 2 And 单位代码 = " & e.DataRow("单位代码"))
        e.DataRow("交流") = DataTables("人员增减").Compute("Count(_Identify)", "进入渠道 = 3 And 单位代码 = " & e.DataRow("单位代码"))
        e.DataRow("军转") = DataTables("人员增减").Compute("Count(_Identify)", "进入渠道 = 4 And 单位代码 = " & e.DataRow("单位代码"))
        e.DataRow("考录") = DataTables("人员增减").Compute("Count(_Identify)", "进入渠道 = 5 And 单位代码 = " & e.DataRow("单位代码"))
        e.DataRow("过渡") = DataTables("人员增减").Compute("Count(_Identify)", "进入渠道 = 6 And 单位代码 = " & e.DataRow("单位代码"))
        e.DataRow("调出") = DataTables("人员增减").Compute("Count(_Identify)", "退出渠道 = 1 And 单位代码 = " & e.DataRow("单位代码"))
        e.DataRow("退休") = DataTables("人员增减").Compute("Count(_Identify)", "退出渠道 = 2 And 单位代码 = " & e.DataRow("单位代码"))
        e.DataRow("辞职辞退") = DataTables("人员增减").Compute("Count(_Identify)", "退出渠道 = 3 And 单位代码 = " & e.DataRow("单位代码"))
        e.DataRow("开除") = DataTables("人员增减").Compute("Count(_Identify)", "退出渠道 = 4 And 单位代码 = " & e.DataRow("单位代码"))
        e.DataRow("死亡") = DataTables("人员增减").Compute("Count(_Identify)", "退出渠道 = 5 And 单位代码 = " & e.DataRow("单位代码"))
End Select

--  作者:lin_hailun
--  发布时间:2013/2/17 16:29:00
--  
 参考一下。

Select Case e.DataCol.Name
    Case "单位代码"
        Dim total As Long
        Total = DataTables("人员增减").Compute("Count(_Identify)", "进入渠道 = 1 And 单位代码 = " & e.DataRow("单位代码"))
        e.DataRow("转任") = Iif(Total = 0, Nothing, Total)
        Total = DataTables("人员增减").Compute("Count(_Identify)", "进入渠道 = 2 And 单位代码 = " & e.DataRow("单位代码"))
        e.DataRow("调任") = iif(Total = 0, Nothing, Total)
End Select

--  作者:hrw68529
--  发布时间:2013/2/17 16:47:00
--  
非常感谢