dianemarie
Instructor
Hello, I have to create a report with a parameter (@RunBy) that allows the user to run the report by Vendor or by Client. Could someone give me a general direction as to how you would then select the data according to the parameter pick? I have thought maybe a table variable (I've worked with them a bit, with help) but I'm not sure how to allow for the two fields, VendorID, ClientID. I've also been playing with CASE statements in the Where clause, but having trouble. My report right now simply says
Where VendorID in (@VendorID).
I need to modify the report to pull records by VendorID if the @RunBy parameter is selected as Vendor, or run by ClientID if the @RunBy parameter is Client. I guess to do this, I'd have to have the @VendorID parameter display vendor or client ID's depending on the @RunBy parameter. What I'm looking for is the best way to attack this...should I focus on getting the WHERE statement to work using a CASE, or should I start thinking about how to make a table variable work, or would some other solution work better? Thanks so much.
Where VendorID in (@VendorID).
I need to modify the report to pull records by VendorID if the @RunBy parameter is selected as Vendor, or run by ClientID if the @RunBy parameter is Client. I guess to do this, I'd have to have the @VendorID parameter display vendor or client ID's depending on the @RunBy parameter. What I'm looking for is the best way to attack this...should I focus on getting the WHERE statement to work using a CASE, or should I start thinking about how to make a table variable work, or would some other solution work better? Thanks so much.