Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

IIF Statement Expand / Collapse
Author
Message
Posted Thursday, February 20, 2014 2:52 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, February 20, 2014 3:23 AM
Points: 50, Visits: 126
I am trying to get an IIF statement to work. it is very simple:


SELECT IIF( -1 < 1, 'TRUE', 'FALSE' ) AS Result

and I get the output:

Msg 102, Level 15, State 1, Line 2
Incorrect syntax near '>'.


is there something I am doing blaringly obviously incorrect.
Post #1543372
Posted Thursday, February 20, 2014 2:54 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 9:13 AM
Points: 40,609, Visits: 37,070
What version of SQL are you working with? If 2005, that's why you're getting an error, IIF was added in SQL 2012.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1543373
Posted Thursday, February 20, 2014 3:26 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, February 20, 2014 3:23 AM
Points: 50, Visits: 126
That might explain alot, I am using 2005!!

thank you
Post #1543385
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse