Question: I am trying to use `IIF()` in a select statement. The boolean expression checks to see if a fields value is equal to an empty string. The syntax is like so:

```
SELECT IIF(field = '','ONe action','Another')

```

I am getting the error "syntax error near =" 

I tried a simple test:

```
SELECT IIF(2 > 1, 'yes','no')

```

and I am getting `"syntax errror near >"`

This is leading me to believe that `IIF` is not working at all. 

I am using SQL SERVER 2008 R2, is there something that needs to be configured to allow IIF() to work? Is there something about the syntax that I am missing? My test is simple as can be and I still get the syntax error. 

Any help would be appreciated. Thanks much!

Answer: 
`IIF` was [introduced in SQL Server 2012](http://msdn.microsoft.com/en-us/library/hh213574.aspx), so that is why it does not work in SQL Server 2008 or SQL Server 2008 R2.
```
DECLARE @a int=45

DECLARE @b int=40

SELECT   
      CASE 
         WHEN @A>@B THEN 'True'

 ELSE 'FALSE'         
      END

```

You can use this solution instead of `IIF`.