Results 1 to 5 of 5

Thread: OleDbParameters filter for Date? {RESOLVED}

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2002
    Posts
    54

    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..
    Last edited by Nintendo_Wizard; Jan 8th, 2003 at 10:47 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width