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