Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 IIf Statement with mixed results
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

2 Posts

Posted - 07/29/2013 :  18:17:15  Show Profile  Reply with Quote

My expression:


If the field in the table is null I get the N/A. However, if the field is not null I get #error.

Where am I going astray? Thank you!

Aged Yak Warrior

549 Posts

Posted - 07/29/2013 :  18:54:40  Show Profile  Reply with Quote
What is the data type of the field MMRValue ?

You can try one of the following:

1. You can change your dataset and modify the select statement to COALESCE(MMRValue, 'N/A');
2. = iif(Fields!MMRValue.value= 0,"N/A",Fields!MMRValue.value)
Go to Top of Page

Starting Member

2 Posts

Posted - 07/29/2013 :  19:10:08  Show Profile  Reply with Quote
thanks for your response.

It is a currency field. We used = iif(Fields!MMRValue.value>0,"N/A",Fields!MMRValue.value)and it worked.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000