Solved

Reporting Services IF statement

Posted on 2010-11-23
3
747 Views
Last Modified: 2012-05-10
I have  the following If statement in Visual Studio reporting services:

=IIf(Fields!Company.Value = "company1", "Technical Hours", "Technical Sub Hours")

The issue I am having is that there are several values equal to "company1" in the database table, and several not equal to "company1" in the database, yet the Report is always outputting the title "Technical Sub Hours".  The "Company" field is String data type.  I have tried using Fields!Company.Value.toString().Equals("company1") but this does not work either.
0
Comment
Question by:zintech
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 21

Assisted Solution

by:Alfred1
Alfred1 earned 166 total points
ID: 34202803
Try this:

=IIf(Trim(Fields!Company.Value) = "company1", "Technical Hours", "Technical Sub Hours")
0
 
LVL 7

Accepted Solution

by:
mr_nadger earned 167 total points
ID: 34204357
also check your cases, "Company1" will give a false in the comparison
0
 
LVL 13

Assisted Solution

by:Jesus Rodriguez
Jesus Rodriguez earned 167 total points
ID: 34206983
What I suggest also is check for the existance of the Company number an not for the string for example
=iif(INSTR(Fields!Company.Value,"1",CompareMethod.Text)>0,"Technical Hours", "Technical Sub Hours")
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
c# ftp code 3 55
SSIS Column mapping 5 40
function that i need to run every 1 min in win form app 6 37
.NET universe documentation poster 2 18
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

737 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