Parameter passing to OleDb command
-
I have two tables in my db. One is an invoice table and the other is a sales table. The sale table has all of the items on the invoices (referenced by invoice number). I want to grab specific invoices at a time (say 3 or more ) The best way I though to do this would be to use an IN statement in the where clause of the SQL stmt. Since I don't know how many I am going to need to grab, I was wondering if it was possible to pass one parameter to the IN clause ( a set of invoice numbers). Or would it be easier to just grab one at a time and append the result to my dataset? For instance: SELECT INVOICES.*, SALES.* FROM INVOICES INNER JOIN SALES ON INVOICE.invoice_number = SALES.invoice_number WHERE (Invoices.invoice_number IN (?)); Where ? could be {1002, 1004, 1100,...)
-
I have two tables in my db. One is an invoice table and the other is a sales table. The sale table has all of the items on the invoices (referenced by invoice number). I want to grab specific invoices at a time (say 3 or more ) The best way I though to do this would be to use an IN statement in the where clause of the SQL stmt. Since I don't know how many I am going to need to grab, I was wondering if it was possible to pass one parameter to the IN clause ( a set of invoice numbers). Or would it be easier to just grab one at a time and append the result to my dataset? For instance: SELECT INVOICES.*, SALES.* FROM INVOICES INNER JOIN SALES ON INVOICE.invoice_number = SALES.invoice_number WHERE (Invoices.invoice_number IN (?)); Where ? could be {1002, 1004, 1100,...)