BAQ Multiple Parameters Mandatory

I created a BAQ with 2 parameters. I know I can make them both mandatory or not. However, my 2 parameters use an “OR” in the Where clause, and I would like to force only 1 populated. Doesn’t matter which one, but doesn’t seem I can do it or not sure how.

For example:

SELECT * FROM TFSHIPDTL WHERE (TFORDNUM = @ORDERNUM OR PACKNUM = @PACKNUM)

Is it possible to make the parameters so that one have to be populated and doesn’t matter which one as long as one is populated?

I don’t know of a way to make the parameters see each other, but the way you have it now, if you don’t fill one it, it just returns nothing right? Wouldn’t that effectively make it required?

edit you’ve got different columns though… I was thinking the same column.

You could use the 2 parameters to in a calculated field, and then filter the results by that column.

case  
    when @PartNum1  <> '' then 'ok' 
    when @PartNum2 <> '' then 'ok' 
    else 'not ok'
end

Put whatever parameters you have in there, then use subquery filter to set that the row only comes back with “ok”. Then if they are both blank, it doesn’t return any rows.

Thanks Brandon. I will take a look and see if that’ll work.

Thank you that worked wonderfully.