-- 作者:东风光魔
-- 发布时间:2017/11/24 19:41:00
-- 连接符不会用,总是报缺少操作数,请老师指点
Dim fls As List(Of String()) = DataTables("拼装类").GetValues("项目名称|分组|性别") For Each fl As String() In fls Dim filter As String = "项目名称 = \'" & fl(0) & "\' and 分组 = \'" & fl(1) & "\' and 性别 = \'" & fl(2) & "\'" Dim drs As List(Of DataRow) = DataTables("拼装类").Select("\'" & filter & "\'", "成绩 DESC") For n As Integer = 0 To drs.Count - 1 \'遍历所有行 If n > 0 AndAlso drs(n)("成绩") = drs(n-1)("成绩") Then \'如果总分和上一行相同 drs(n)("名次") = drs(n-1)("名次") \'则排名等于上一行 Else drs(n)("名次") = n + 1 \'设置排名 End If Next Next
此主题相关图片如下:qq截图20171124193742.png
|