Look into passing a dynamic where clause. You are making much more work for yourself using the format you have chosen.Try to simply pass two variables, 1 for your include list and 1 for your not include.so :Declare @Include varchar(500),@NotInclude Varchar(500)set @Include = '''Outside Home'',''maybe insude'''set @NotInclude = '''hello you'',''office'',''inside house'''Print @IncludePrint @NotIncludedeclare @MyStr varchar(2000)set @MyStr = 'select * from MYTable awhere a.MyCol in ( ' + @Include + ' )and Not a.MyCol in ( ' + @NotInclude + ' )'exec (@Mystr)
Success is 10% Intelligence, 70% Determination, and 22% Stupidity.\_/ _/ _/\_/ _/\_/ _/ _/- 881