Foxtable(狐表)用户栏目专家坐堂 → [求助]表格结构转换


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

主题:[求助]表格结构转换

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


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

Dim sql As String
Dim v1() As String=DataTables("表A").GetComboListString("日期","","日期").split("|")

For n1 As Integer =0 To v1.Length-1
    SQL+=" ,Max(iif(日期 = #" & v1(n1) & "#,考勤,'')) As A" & n1
Next
SQL="Select 姓名" & SQL & "  From{表A}  Group by 姓名"

Dim dtb As New DataTableBuilder("统计")
dtb.Build()

Dim t1 As Table = Tables("统计")
t1.StopRedraw
t1.DataTable.Fill(SQL,True)
For n1 As Integer =0 To v1.Length-1
    t1.grid.setData(0,n1+2, Format(Cdate(v1(n1)),"yyyy-MM-dd"))
Next
t1.ResumeRedraw

MainTable= t1
[此贴子已经被作者于2013-6-20 6:53:07编辑过]

 回到顶部