OleDbParameters filter for Date? {RESOLVED}
In an access db I want to give the user the ability to put search criteria in a combobox and DateTimePicker. Then the report will display their results. I have the OLEDBDataAdapter SelectCommand as follows:
SELECT Date, Customer, Total Sales
FROM CsDB
WHERE (Date >=?) AND (Date<=?) AND (Customer=?);
Then I use the OleDbDataAdapter.SelectCommand.Parameters("Date").Value = DateTimePicker.Text OleDbDataAdapter.SelectCommand.Parameters("Date1).Value = DateTimePicker.Text
OleDbDataAdapter.SelectCommand.Parameters
("Customer").Value = Combobox1.SelectedItem.
This pulls up the customer info, but the problem is it pulls records for all the dates within the parameters and duplicates the customer several times.
Customer # of Orders Total Sales
For example: John Doe 65 4545.20
It makes an entry for every date, then duplicates the customer. I does exactly what the SELECT Statement tells it to do. I can't seem to find a way around it. Anybody got a better way? Thanks..