交易时间是日期型而非字符型
Dim t As Table = Tables(e.form.Name & "_Table1")
Dim y, m As Integer
y = e.Form.Controls("ComboBox1").value
m= e.sender.value
Dim fl As String = "交易时间>= #" & New Date(y,m,1) & "# And 交易时间<= #"
fl+ = New Date(y,m,Date.DaysInMonth(y,m)) & "#"
If DataTables("建行对账单").Find(fl) IsNot Nothing Then
Dim b As New GroupTableBuilder("建行汇总表",DataTables("建行对账单"))
b.Groups.AddDef("交易时间",DateGroupEnum.Year,"交易年份")
b.Groups.AddDef("交易时间",DateGroupEnum.Month,"交易月份")
b.Groups.AddDef("账号")
b.Groups.AddDef("户名")
b.Totals.AddDef("贷方","贷方发生额")
b.Totals.AddDef("借方","借方发生额")
b.VerticalTotal =True
b.Filter = fl
t.DataSource =b.BuildDataSource()
Else
MessageBox.show("不存在此年月的数据!请重新输入")
End If
[此贴子已经被作者于2011-10-7 13:02:34编辑过]