Solved

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

Posted on 2008-10-09
5
659 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

896 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now