Foxtable(狐表)用户栏目专家坐堂 → 统计空值的次数


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

主题:统计空值的次数

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/8/12 15:19:00 [显示全部帖子]

Dim sum As Double = 0
For Each dr As DataRow In DataTables("表A").Select("")
    Dim d As Date = dr("第一列")
    If d.DayOfWeek = 0 OrElse d.DayOfWeek = 6 Then
        If dr.IsNull("第二列") OrElse dr.IsNull("第三列") Then
            sum = sum + 1
        End If
    Else
        If dr.IsNull("第二列") Then
            sum = sum + 1
        End If
        If dr.IsNull("第三列") then
            sum = sum + 1
        End If
    End If
Next
msgbox(sum)

 回到顶部