• The '*' is killing you. Use '%' instead.

    If you want to search for text that for example contains % or other special characters you have to escape them.

    See the example below:

    SELECT * FROM

    (

    SELECT UserName + '&%' + Email AS A FROM Employees

    ) G

    WHERE G.A LIKE '%s&!%x%' ESCAPE '!'

    I am concatenating two fields adding &% in between. No escaping needed there.

    And I want to look for any record that has the literal pattern 's&%x' inside it

    So in the LIKE however, I start with an '%s (the equivalent of *), follow with an 's', follow with an '&' (no escaping needed) and then I escape the '%' using any character I like, so I chose '!'. Then follows 'x' and '%' for the rest of the string.

    Pretty straightforward right?

    Cheers

    Dimitris