Coloplast
asked on
SQL CAST or CONVERT
I'm trying to convert an INT to VARCHAR in my CASE statement by using the following:
But I get the following error:
Conversion failed when converting the varchar value 'Mixed' to data type int.
Any ideas?
Best regards
Rasmus
SELECT CASE
WHEN CAST(AuthenticationMode AS VARCHAR(7)) = '0' THEN 'Mixed'
WHEN CAST([AuthenticationMode] AS VARCHAR(7)) = '1' THEN 'Windows'
ELSE [AuthenticationMode]
END AS 'AuthenticationMode'
But I get the following error:
Conversion failed when converting the varchar value 'Mixed' to data type int.
Any ideas?
Best regards
Rasmus
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER