February 20, 2014 at 2:52 am
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.
February 20, 2014 at 2:54 am
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, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
February 20, 2014 at 3:26 am
That might explain alot, I am using 2005!!
thank you
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply