IN() function failure

50 views Asked by At

Can somebody please help me to understand why the IN() function does not work in any of the below attempts?

DECLARE @Company VARCHAR(50) = ('''ABC''' + ', ' + '''DEF''' + ', ' + '''VEG''' + ', ' + '''HIJ''') --+ WNY, VEG''')
PRINT @Company
PRINT IIF('VEG' IN (@Company), 'TRUE', 'FALSE');


DECLARE @Company2 VARCHAR(50) = ('''ABC, DEF, VEG, HIJ''')
PRINT @Company2
PRINT IIF('VEG' IN (@Company2), 'TRUE', 'FAL

Tried running the command as presented and both IIF()s return false.

0

There are 0 answers