0
我有一個從存儲過程運行的SSRS報告。我有兩個必須選擇的參數。我的第一個參數完美的作品,而是選擇了第二個參數時(REP)它獲取該報告忽略,返回所有衆議員T-SQL不執行WHERE子句的第二部分SSRS
@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))
感謝它的工作,將在幾分鐘內接受正確的答案! – Wilest