C# 如何在EditValue中为GridView设置筛选器已更改?Winforms-Devexpress
当用户从下拉列表中选择某个项目时,我需要过滤gridview。所以我在edit value change事件中编写了这个查询代码,但我的查询是错误的C# 如何在EditValue中为GridView设置筛选器已更改?Winforms-Devexpress,c#,sql,winforms,ms-access,gridview,C#,Sql,Winforms,Ms Access,Gridview,当用户从下拉列表中选择某个项目时,我需要过滤gridview。所以我在edit value change事件中编写了这个查询代码,但我的查询是错误的 SELECT InvoiceId, InvoiceNumber, InvoiceDate, (Select CustomerId from Customer Where Customer.CustomerId=NewInvoice_1.CustomerName) AS CustomerId, (Select CustomerName from
SELECT InvoiceId, InvoiceNumber, InvoiceDate,
(Select CustomerId from Customer Where Customer.CustomerId=NewInvoice_1.CustomerName) AS CustomerId,
(Select CustomerName from Customer where Customer.CustomerId = NewInvoice_1.CustomerName) AS CustomerName,
DueDate, Tax, GrandTotal, CompanyId
FROM NewInvoice_1
Where InvoiceDate < 06-04-2014; // error in where condition
我这里有6个条件来筛选此发票日期
1发票日期2014年4月1日之前
2发票日期自2014年3月1日起至2014年3月31日止
3本周的发票日期,即从现在起的最后7天
4发票日期上周即今天-14天至+7天
5本月的发票日期,即从现在起的最后30天
6发票日期最近一个月,即今天-60天到+30天
请帮助我如何对此进行查询我认为在如何传递日期方面存在问题
SELECT InvoiceId, InvoiceNumber, InvoiceDate,
(Select CustomerId from Customer Where Customer.CustomerId=NewInvoice_1.CustomerName) AS CustomerId,
(Select CustomerName from Customer where Customer.CustomerId = NewInvoice_1.CustomerName) AS CustomerName,
DueDate, Tax, GrandTotal, CompanyId
FROM NewInvoice_1
Where InvoiceDate < '06-04-2014';
这可能会起作用,或者将日期传递为CDate'06-04-2014'为什么要使用DevXPress筛选器选项而不是使用DataView筛选器?