我有一个从存储过程运行的 SSRS 报告。我有 2 个必须选择的参数。My first parameter works perfectly, but when the 2nd parameter is chosen (Rep) it gets ignored by the report and returns all the Reps.
@Town Varchar(100)
,@Rep Varchar(100)
select
a.Customer
,a.CustName
,a.Rep
,a.Town
,a.Qty
,a.SalesType
,b.Qty1
,c.Qty2
......
from #1 a
left join #2 b
on a.Rep = b.Rep
and a.Town = b.Town
and a.Customer = b.Customer
and a.SalesType = b.SalesType
left join #3 c
..........
WHERE ('ALL' IN (@Town)) OR (a.Town IN (@Town))
and ('ALL' IN (@Rep)) OR (a.Rep IN (@Rep))