我的存储过程中有几个复杂的条件,例如
if @Acr != '' and @Acr != '<Select All>'
begin
delete from #temp where O_client != @Acr and O_originreason != 'RTE'
end
if @Acr = '<Select All>'
begin
delete from #temp where LEFT(O_client, 5) = 'WS80_'
AND O_client IS NULL
AND O_originreason != 'RTE'
end
if @Chnl != '' and @Chnl != '<Select All>'
begin
delete from #temp where C_Channel != @Chnl
end
我希望摆脱它,并在报告中的DataSet过滤器中重新实现它。但我无法理解如何建立这样复杂的条件。
答案 0 :(得分:0)
好的,我做到了。
我做了一个表达式返回bool并将其与true
进行比较