以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  判断值为空的行有多少个  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=79222)

--  作者:文道古月
--  发布时间:2015/12/26 21:54:00
--  判断值为空的行有多少个
老师好,有什么最简单的方法,判断值为空的行有多少个?
--  作者:lsy
--  发布时间:2015/12/27 9:33:00
--  
Dim t As Table = CurrentTable
Dim i As Integer
For Each r As Row In t.Rows
    For Each c As Col In t.Cols
        If r.IsNull(c.Name) = False Then
            i + = 1
            Exit For
        End If
    Next
Next
MessageBox.Show(t.Rows.Count - i)

--  作者:大红袍
--  发布时间:2015/12/27 12:04:00
--  
Dim filter As String = "1=1"
For Each dc As DataCol In DataTables("表A").Datacols
    filter &= " and " & dc.name & " is null"
Next
Dim count As Integer = DataTables("表A").compute("count(_Identify)", filter)
msgbox(count)