views:

28

answers:

1

Hello,

im using the PATINDEX sentence into a case sentence:

select Choosed1=
CASE PATINDEX('%1|%',field1)
//Here im getting an error:
WHEN >0 THEN 'X'
END
from testtable

How could i put the >0 condition to avoid the error?

Thanks in advance

Best Regards.

Jose

+4  A: 
CASE
    WHEN PATINDEX('%1|%',field1) > 0 THEN 'X'
    ELSE 'Y'
END
AdaTheDev
Thanks a lot.Regards.Jose
Josemalive