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

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

moxioron
Starting Member

2 Posts

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

My expression:

=iif(Fields!MMRValue.value="","N/A",Fields!MMRValue.value)

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!

MuMu88
Aged Yak Warrior

547 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');
OR
2. = iif(Fields!MMRValue.value= 0,"N/A",Fields!MMRValue.value)
Go to Top of Page

moxioron
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  
 New 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.03 seconds. Powered By: Snitz Forums 2000