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编辑过]