Ciao a tutti (! Il mio primo post sul Stack),come utilizzare SQL WHERE CASE con NOT IN o uguale allo stesso tempo?
Questo funziona:
where
Tran_date between @FromDate and @ToDate
and Range = @Range
and Store_ID =
case when @Range = 'RangeName' then
1234
else
Store_ID
end
ma come posso realizzare questo ?:
where
Tran_date between @FromDate and @ToDate
and Range = @Range
and Store_ID
case when @Range = 'RangeName' then
not in (1234, 5678)
else
Store_ID
end