Foxtable(狐表)用户栏目专家坐堂 → [求助]


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

主题:[求助]

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


加好友 发短信
等级:婴狐 帖子:74 积分:561 威望:0 精华:0 注册:2014/2/14 13:54:00
  发帖心情 Post By:2014/6/16 21:14:00 [只看该作者]

For Each n As String In DataTables("表A").GetValues("第一列", "第一列 is not null")
    Dim dr1 As DataRow = DataTables("表A").Find("第一列 = '" & n & "'", "第二列")
    Dim dr2 As DataRow = DataTables("表A").Find("第一列 = '" & n & "'", "第二列 desc")
    Dim drr1=(n & " : " & math.Abs(dr2("第五列") - dr1("第五列")))
    Dim drr2=(n & " : " & math.Abs(dr2("第六列") - dr1("第六列")))   
Next
我不想用msgbox函数弹出来每个值
是这样 我想针对每一行的DRR1和DRR2的值赋值到新表-表D中。表D中包含表A中的第一列,DRR1与DRR2

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2014/6/16 21:18:00 [只看该作者]

For Each n As String In DataTables("表A").GetValues("第一列", "第一列 is not null")
    Dim dr1 As DataRow = DataTables("表A").Find("第一列 = '" & n & "'", "第二列")
    Dim dr2 As DataRow = DataTables("表A").Find("第一列 = '" & n & "'", "第二列 desc")
    Dim fdr As DataRow = DataTables("表D").Find("第一列 = '" & n & "'")
    If fdr Is Nothing Then
        fdr = DataTables("表D").AddNew
        fdr("第一列") = n
    End If
    fdr("第二列") = math.Abs(dr2("第五列") - dr1("第五列"))
    fdr("第三列") = math.Abs(dr2("第六列") - dr1("第六列"))
Next

 回到顶部
总数 12 上一页 1 2