Foxtable(狐表)用户栏目专家坐堂 → 请各位老师指点一下


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

主题:请各位老师指点一下

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


加好友 发短信
等级:八尾狐 帖子:1812 积分:12999 威望:0 精华:14 注册:2008/10/11 18:07:00
  发帖心情 Post By:2008/12/6 19:19:00 [显示全部帖子]

'''
Dim Da As DataTable = DataTables("表2")
DataTables("另表").DataRows.Clear()
Dim TS,T As String
dim i,i1,sum,rs as Integer
For  i  = 1 to 6
    For Each dr As DataRow in Da.Select("姓名" & i & ">''")
         If Ts Is Nothing OrElse Ts.Indexof(dr("姓名" & i )) = -1 Then 
             Ts = Ts  & "," & dr("姓名" & i )
        End If
     Next
Next
rs = Ts.substring(1).split(",").Length
Tables("另表").Addnew(rs)
For i  = 0 to rs-1
    T = Ts.substring(1).split(",")(i)
    Tables("另表").rows(i)("姓名")=T
    sum=0
    for i1 =1 to 6
        sum =sum+Da.Compute("Sum(数量" & i1 & ")","姓名" & i1 & "='" & T & "'")
    Next  
    Tables("另表").rows(i)("数量") = SUm
Next

 回到顶部