• Sean, that worked perfect...

    I understood the Replace function was doing nothing, I had written it at a time when I was in fact replacing something....

    Just to get a better understanding of what your string is doing:

    select @sql = @sql + 'and REPLACE(' + @system_Status + ','''','''') LIKE ''%'' + system_Status + ''%'''

    The concatenation begins with 'and correct?

    Why is it that you're using plus signs around @system_Status?

    Furthermore, why in the REPLACE function did you change the last two inputs to '''' as opposed to the original '' ... is this actually replacing something now?

    Sorry for all the questions, I'd like to be able to work through these myself without help in the future, and I'm attempting to learn