I am looking at creating a parameter with two conditions, but not sure how to set this up. I have two tables and users would link a program to a type. I'm creating this report to check where there are bad links.
For example
Program of "Fruit" = Apple. User would pick from the drop down Fruit as the program and it would display all records that were not linked as Fruit = Apple
With example data below it should pull back ID 4 Fruit is linked to Lettuce.
If they selected Veggie it should bring back ID 5 Veggie is linked to Apple
Example Data
create table [Program] ( id int, program nvarchar(25), item_id int ) create table [main] ( id int, type nvarchar(25) ) insert [program] values (1, 'Veggie', 2), (2, 'Fruit', 1),(3, 'Fruit', 3), (4, 'Fruit', 4), (5, 'Veggie', 5); insert [main] values (1, 'Apple'), (2, 'Tomatoe'), (3, 'Apple'), (4, 'Lettuce'), (5, 'Apple');
Query
select p.id, p.program, m.type from program p join main m on p.item_id = m.id where p.program = 'fruit' and m.type <> 'apple'
SSRS Report
select * from program select p.id, p.program, m.type from program p join main m on p.item_id = m.id where p.program = @Program and m.type <> 'apple'
- Edited by Lezgettdrunk 10 hours 53 minutes ago grammar fix