本文介绍了如何在EditValue中为GridView设置过滤器改变了?的WinForms的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户从下拉列表中选择某个项目时,我需要过滤gridview。所以我在编辑值更改事件中编写此查询代码,但我的查询是错误



I need to filter the gridview when user select some item from dropdown. 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





我有6个条件来过滤这个发票日期



1)InvoiceDate在2014年4月1日之前

2)InvoiceDate从01-03-2014开始31-0302014结束

3)InvoiceDate这是从现在开始的最后7天

4)InvoiceDate上周现在(今天) - 14天到+7天

5)InvoiceDate从现在起30天内的ThisMonth

6)InvoiceDate LastMonth现在(今天) - 60天到+30天



帮助我如何形成查询



I have 6 conditions here to filter this invoice date

1) InvoiceDate before 01-04-2014
2) InvoiceDate startfrom 01-03-2014 endon 31-0302014
3) InvoiceDate thisweek that is last 7 days from now
4) InvoiceDate lastweek that is now(Today) - 14 days to +7 days
5) InvoiceDate ThisMonth that is last 30 days from now
6) InvoiceDate LastMonth that is now(today) - 60 days to +30 days

Help me to how to form query for this

推荐答案

这篇关于如何在EditValue中为GridView设置过滤器改变了?的WinForms的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 17:53