Foxtable(狐表)用户栏目专家坐堂 → 统计个数


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

主题:统计个数

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


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

方法一:

 

Dim t As Table = Tables("表A")
For i As Integer = 2 To 22
    msgbox(t.Cols(i).name)
Next

 

方法二:

 

Dim t As Table = Tables("表A")
For Each c As Col In t.Cols
    If c.name Like "*第*" Then
        msgbox(c.name)
    End If
Next

 


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


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

Dim t As Table = Tables("表A")

Dim r As Row = t.Current

Dim sum As Double = 0
For Each c As Col In t.Cols
    If c.name Like "*第*" Then
       
        If r(c.name) = "总分" Then sum += 3
       
        If r(c.name) = "卫生" OrElse r(c.name) = "纪律" OrElse r(c.name) = "两操" Then sum += 2
    End If
Next

r("总分") = sum


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


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

Dim t As Table = Tables("表A")
For Each r As Row In t.Rows
    Dim sum As Double = 0
    For Each c As Col In t.Cols
        If c.name Like "*第*" Then
           
            If r(c.name) = "总分" Then sum += 3
           
            If r(c.name) = "卫生" OrElse r(c.name) = "纪律" OrElse r(c.name) = "两操" Then sum += 2
        End If
    Next
   
    r("总分") = sum
Next

 回到顶部