我的 DGV 中有这个日期:
14/06/2012
15/07/2012
16/07/2012
17/07/2012
我将过滤器设置为:([supplier_invoice_date] >= '13/07/2012') AND ([supplier_invoice_date] <= '17/07/2012')
过滤器返回此(所有日期):
14/06/2012
15/07/2012
16/07/2012
17/07/2012
另一个测试:
筛选:([supplier_invoice_date] >= '15/07/2012') AND ([supplier_invoice_date] <= '17/07/2012')
结果:
15/07/2012
16/07/2012
17/07/2012
筛选:([supplier_invoice_date] < '17/06/2012')
结果:
14/06/2012
15/07/2012
16/07/2012
我认为只需要几天而不需要几个月。
这是我的代码:
Dim dt As New DataTable
Dim suppliersinvoices_data_query As String = ("DATE_FORMAT(MIN(supplier_invoice_date), '%d/%m/%Y') AS supplier_invoice_date, ...")
Dim invoice_objDataAdapter As New MySqlDataAdapter(suppliersinvoices_data_query, objConn)
invoice_objDataAdapter.Fill(dt)
Dim MyFilter As New DataView(dt)
MyFilter.RowFilter = "([supplier_invoice_date] >= '13/07/2012') AND ([supplier_invoice_date] <= '17/07/2012')"
invoicesresults_datagrid_search_supplierinvoice.DataSource = MyFilter