Reputation: 6505
I have customers and programs. A customer can be in many programs and I have the CustomerPrograms table for the many to many data. I of course also have the Customers table and the Programs table. In SSRS the client wants to be able to Multi Select the programs parameter (query loaded from Programs table). They also want to see a comma delimited list of the programs in the grid. I wrote a UDF to handle the grid part but I am baffeled about how to handle the Multi Select parameter filtering customers who can be in none, one or many of the programs.
Upvotes: 0
Views: 120
Reputation: 6505
I actually figured it out and it turned out to be much easier than I thought - for those interested part ot the where clause now looks like this (@program is the multi select parameter):
and exists (select custprog_id from customers_programs (nolock)
where cust_id = customers.cust_id and program_id in (@program))
Upvotes: 2