Skip to content
Advertisement

SQL – Datatypes varchar and varchar are incompatible in the modulo operator [closed]

enter image description hereI have the following query that used to work but returns the error addressed on the title. The last line is indicated within the error.

Advertisement

Answer

Change this

To this

Because the goal is to concatinate the % character to the column. So that it creates a string that’s usable by the LIKE.

But in MS Sql Server you escape a single quote with a single quote.

So the ''%'' is messing things up.
Because the % is seen as the modulus operator.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement