简体   繁体   English

如何在EditValue中设置GridView的筛选器已更改? Winforms Devexpress

[英]How to set filter for GridView in EditValue changed ? Winforms Devexpress

I need to filter the gridview when user select some item from dropdown. 当用户从下拉列表中选择某些项目时,我需要过滤gridview。 So I write this query code in edit value change event but my query is error 所以我在编辑值更改事件中写入此查询代码,但查询错误

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

I have 6 conditions here to filter this invoice date 我在这里有6个条件来过滤此发票日期

1) InvoiceDate before 01-04-2014 1)2014年1月4日之前的发票日期

2) InvoiceDate startfrom 01-03-2014 endon 31-0302014 2)发票日期从2014年3月3日开始到2014年3月30日结束

3) InvoiceDate thisweek that is last 7 days from now 3)这周的InvoiceDate是从现在开始的过去7天

4) InvoiceDate lastweek that is now(Today) - 14 days to +7 days 4)现在(今天)上周的InvoiceDate-14天到+7天

5) InvoiceDate ThisMonth that is last 30 days from now 5)从现在起过去30天的InvoiceDate ThisMonth

6) InvoiceDate LastMonth that is now(today) - 60 days to +30 days 6)现在(今天)的InvoiceDate LastMonth-60天至+30天

Help me to how to form query for this 帮助我如何对此进行查询

I think there is an issue in how you pass the date. 我认为您如何安排日期存在问题。

 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';

This might work or pass the date as CDate('06-04-2014') 这可能有效或将日期设置为CDate('06 -04-2014')

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在运行时设置过滤器? 用于C#,Winforms,DevExpress中的gridview - How to set Filter in run time ? for gridview in C#, Winforms, DevExpress 如何将单击事件设置为行中的所有单元格? Gridview Winforms Devexpress - How to set click Event to all cells in a Row ? Gridview Winforms Devexpress 如何通过例如过滤 GridView 数据。 第二个或第十个字符,DevExpress Winforms? - How to filter GridView data by eg. second or tenth character, DevExpress Winforms? 如何从Access数据库获取值并在C#winforms Devexpress中的Gridview中进行设置? - How to get the values from Access Database and set in Gridview in C# winforms Devexpress? 如何在Winforms Devexpress中将XtraReport设置为GroupPanel? - How to set a XtraReport into a GroupPanel in Winforms Devexpress? 如何在GridView中过滤devexpress lookupedit数据源 - How to filter devexpress lookupedit datasource in gridview 如何在Winforms DevExpress中将GridView单元格值保存到Access数据库中? - How to Save GridView Cell Values to Access Database in winforms DevExpress? 如何在Winforms DevExpress中将GridView数据保存到Access数据库? - How to Save GridView Data's to Access Database in Winforms DevExpress? 在Winforms Devexpress中,如何在GridView中的单元格中获取TextEdit值? - How to get TextEdit value to Cell in GridView in Winforms Devexpress? 如何清除Gridview Winforms Devexpress中有界列的单元格值? - How to clear a cell value of bounded column in Gridview Winforms Devexpress?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM