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


  共有1476人关注过本帖平板打印复制链接

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

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


加好友 发短信
等级:幼狐 帖子:143 积分:1769 威望:0 精华:0 注册:2016/5/10 15:59:00
我要把空值当做1,为什么不能正确计算呢  发帖心情 Post By:2017/11/13 16:03:00 [只看该作者]

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

 回到顶部