Foxtable(狐表)用户栏目专家坐堂 → 我要把空值当做1,为什么不能正确计算呢


  共有1508人关注过本帖树形打印复制链接

主题:我要把空值当做1,为什么不能正确计算呢

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/11/13 16:18:00 [显示全部帖子]

Select Case e.DataCol.name
    Case "第一列","第二列","第三列","第四列"
        Dim d1 As Double = val(e.DataRow("第一列"))
        Dim d2 As Double = val(e.DataRow("第二列"))
        Dim d3 As Double = val(e.DataRow("第三列"))
        Dim d4 As Double = val(e.DataRow("第四列"))
        Dim d5 As Double
       
       
        If e.DataRow.IsNull("第一列") Then
            e.DataRow("第一列") = Nothing
            d1 = 1
        End If
       
        If e.DataRow.IsNull("第二列") Then
            e.DataRow("第二列") = Nothing
            d2 = 1
        End If
       
        If e.DataRow.IsNull("第三列") Then
            e.DataRow("第三列") = Nothing
            d3 = 1
        End If
        If e.DataRow.IsNull("第四列") Then
            e.DataRow("第四列") = Nothing
            d4 = 1
        End If
       
        d5=d1*d2*d3*d4
        e.DataRow("第五列")=d5
End Select

 回到顶部