按操作要求,需要创建一个副本,需要在副本里面进行统计。
Dim tb2 As WinForm.Table
tb2 = e.Form.CreateSQLTable("Table1", "Select * Flom {表名}" ,"数据来源")
' e.Form.AddControl(tb2)
For i As Integer = 0 To cns1.Length - 1
Dim d As Date = new Date(Date.Today.Year, i+1, 1)
Dim cp As Integer = DataTables("tb2").compute("count(姓名)", filter & " and 日期 >= #" & d & "# and 日期 < #" & d.AddMonths(1) & "#")
e.DataRow(cns1(i)) = IIF(cp=0,Nothing,cp)
Dim c As Double = DataTables("tb2").compute("sum(数量)", filter & " and 日期 >= #" & d & "# and 日期 < #" & d.AddMonths(1) & "#")
e.DataRow(cns2(i)) = IIF(c=0,Nothing,c)
Next
End If
错误提示: 不存在名称为”tb2"的"DataTable!
[此贴子已经被作者于2018/9/14 18:22:22编辑过]