Solved

Reporting Services SYNTAX help for EXPRESSION....????

Posted on 2008-10-09
5
669 Views
Last Modified: 2012-05-05
Experts:

I'm using this field for displaying a PERCENTAGE calc of 2 different COUNT FIELDS in my RS Report.

=cint(count(Fields!ORDERID.Value, "OrderCount") / Fields!CALLCOUNT.Value*100)& " %"

However, on occasion one or both of the COUNT FIELDS will be NULL and so I get an #ERROR displayed in the report when this happens. I would like this percentage calculation to display "N/A" when this happens instead of the system standard #ERROR.

Can someone help me with the SYNTAX needed in order to do this?
0
Comment
Question by:MIKE
  • 3
  • 2
5 Comments
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22684572
Try this:

=iif(isnothing(cint(count(Fields!ORDERID.Value, "OrderCount") / Fields!CALLCOUNT.Value*100)& " %"),"N/A",cint(count(Fields!ORDERID.Value, "OrderCount") / Fields!CALLCOUNT.Value*100)& " %")
0
 
LVL 17

Author Comment

by:MIKE
ID: 22735683
Didn't work I receive the same:    #Error

M
0
 
LVL 39

Accepted Solution

by:
BrandonGalderisi earned 500 total points
ID: 22735932
Let's try a different approach :)
=iif(isnothing(Fields!ORDERID.Value) or isnothing(Fields!callcount.value),"N/A",cint(count(Fields!ORDERID.Value, "OrderCount") / Fields!CALLCOUNT.Value*100)& " %")

Open in new window

0
 
LVL 17

Author Comment

by:MIKE
ID: 22735957
Still get:    #Error
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22736877
hmmm... I'd try the request attention link at the top and see what we're doing wrong here.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sql, case when & top 1 14 27
Are triggers slow? 7 12
SQL Server sunbquery nested in a CASE statement in a SELECT statement 5 16
job schedule 8 18
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question