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 ««12

IIF-function gives error Expand / Collapse
Author
Message
Posted Tuesday, January 29, 2013 6:21 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, October 2, 2014 3:53 AM
Points: 73, Visits: 163
Anthony,

IIF is a new SQL-function in SQL Server 2012 and should work. Your suggestion though works like a charm in all panes so I think I'll use that one.

Thanks a lot. Afterall is makes not much difference in which forum the post is dropped, only the confusion factor gets maximized. Sorry for that.

Thanks again,

Robert
Post #1412987
Posted Tuesday, January 29, 2013 6:25 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, December 8, 2014 1:45 AM
Points: 5,221, Visits: 5,120
Appreciate that IIF is new in 2012, just with it being in a 2008 forum, I automatically assumed IIF = SSRS IIF not a SQL IIF.

Hence why it is always best to put topics in the right forum for the version of SQL your running as you say, saves on the confusion.

Also personally, I like CASE better than IIF, as I find nested IIF's can get a bit messy, where as CASE is easy to read.




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1412989
Posted Tuesday, January 29, 2013 6:30 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Thursday, October 2, 2014 3:53 AM
Points: 73, Visits: 163
Agree
Post #1412994
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse