>So, can you translate these conditions into English? Is it the same as
>
>When NoStatus = @NoStatus you want rows with Status >=@Status
>for NoStatus = @NoStatus1 you want rows with Status >=@Status1
Yes, this is what it is.
>If my interpretation is correct and NoStatus can only be one of the 4 statuses, then you can convert this condition into CASE based.
>
>1 = case Client.NoStatus when @NoStatus
>then case when Client.Status >= @Status then 1 else 0 end
>when @NoStatus1
>then case when Client.Status >= @Status1 then 1 else 0 end
>etc.
>end
I will check the execution plan on such approach and I will let you know.