IIF problem
-
Hi I'm trying to use the Iif function. I've had a look on MSDN and it seems like it is valid in SQL server express but I get an error saying that there is an error near the = sign in the Iif function. I'm using
IIF(IsConsultant = -1, 'Yes', '') AS Consultant
which is giving me the error. Am I using the wrong function for SSE or am I doing something wrong. The data type for the IsConsultant field isint
Many thanksThe FoZ
-
Hi I'm trying to use the Iif function. I've had a look on MSDN and it seems like it is valid in SQL server express but I get an error saying that there is an error near the = sign in the Iif function. I'm using
IIF(IsConsultant = -1, 'Yes', '') AS Consultant
which is giving me the error. Am I using the wrong function for SSE or am I doing something wrong. The data type for the IsConsultant field isint
Many thanksThe FoZ
In SQL Server, you have the CASE statement to do this:
SELECT CASE IsConsultant WHEN -1 THEN 'Yes' ELSE '' END AS Consultant
Deja View - the feeling that you've seen this post before.
-
In SQL Server, you have the CASE statement to do this:
SELECT CASE IsConsultant WHEN -1 THEN 'Yes' ELSE '' END AS Consultant
Deja View - the feeling that you've seen this post before.