Skip to content
Advertisement

IIF(…) not a recognized built-in function

I’m trying to use this in Microsoft SQL Server 2008 R2:

But I get an error:

IIF(...) is not a recognized built-in function name

Is IIF() only compatible with a later version?

Is there an alternate function I can use?

Advertisement

Answer

IIF comes from SQL 2012. Before then, you can use CASE:

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement