• ChrisM@Work (8/27/2013)


    Why are you using IN and not = for these comparisons?

    SV00300.CUSTNMBR in (@CUSTNMBR)

    or SV00300.LOCATNNM in (@LOCATNNM)

    or SV00300.Contract_Number in (@Contract_Number)

    If any of these variables are a comma-delimited list, they won't be resolved by SQL Server in the way you are expecting. You'll need to rework the code to resolve the items in the list or alternatively use dynamic SQL.

    I agree! You may have to handle comma-delimited fields using custom function. I had faced such issue where it works when I select a single value from parameter but doesn't when I select multiple.