Foxtable(狐表)用户栏目专家坐堂 → 统计列的不重复记录数


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

主题:统计列的不重复记录数

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


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

参考

 

 Dim dtb As New DataTableBuilder("统计")
dtb.AddDef("第一列", Gettype(String), 16)
dtb.AddDef("总数量", Gettype(Integer))
dtb.AddDef("总批次", Gettype(Integer))
dtb.Build()
For Each nm As String In DataTables("表A").GetValues("第一列")
    Dim dr As DataRow = DataTables("统计").AddNew()
    dr("第一列") = nm
    dr("总数量") = DataTables("表A").Compute("Sum(数量)","第一列 = '" & dr("第一列") & "'")
    dr("总批次") = DataTables("表A").GetValues("第六列", "第一列 = '" & dr("第一列") & "'").Count
Next
MainTable= Tables("统计")

 

http://www.foxtable.com/help/topics/2394.htm

 


 回到顶部