I have 4 sets of parameters and all need to go to where clause and all are string values:

WHERE CASE WHEN (@ItemFor='' and @ItemTo='') THEN id like '%' ELSE id between @ItemFor and @ItemTo END AND CASE WHEN (@CodeFrom='' and @CodeTo='') THEN Code like '%' ELSE code between @CodeFrom and @CodeTo END

You could simplify and use this condition:

WHERE ((@ItemFor='' and @ItemTo='' AND id like '%') OR id between @ItemFor and @ItemTo) AND ((@CodeFrom='' and @CodeTo='' AND Code like '%') OR code between @CodeFrom and @CodeTo)

and now syntax is correct.

Moreover, id like '%' and Code like '%' make no sense, because they are always true. They can be read as "check if id (or Code) is anything", so they can (should) be removed.