Foxtable(狐表)用户栏目专家坐堂 → 等级划分漏统数据如何处理


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

主题:等级划分漏统数据如何处理

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


加好友 发短信
等级:超级版主 帖子:110738 积分:563610 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/2/7 20:44:00 [显示全部帖子]

Dim cnt As Integer = DataTables("表A").DataRows.Count

Dim vals() As Double = {0.1,0.25,0.4,0.20}
Dim tops(3) As Integer
For i As Integer = 0 To vals.length - 1
    tops(i) = Math.Floor(cnt * vals(i))
Next

Dim djs() As String = {"A","B","C","D"}
Dim drs As List (of DataRow)
For k As Integer = 0 To tops.length - 1
    drs = DataTables("表A").SQLSelect("等级 is null",tops(k), "分数 Desc")
    For i As Integer = 0 To drs.Count - 1
        drs(i)("等级") = djs(k)
    Next
    DataTables("表A").SQLUpdate(drs)
Next
DataTables("表A").SQLReplaceFor("等级","E", "等级 is null")
DataTables("表A").Load
Tables("表A").Sort = "分数 Desc"

 回到顶部