Solved

How to create If statement in Visual Studio reporting services

Posted on 2010-11-22
4
869 Views
Last Modified: 2012-05-10
I know how to create a basic IF statement in Visual Studio reporting services.  However, I would like to add another conidition to the statement.  For example, I would like to check if a field equals a value AND equals another value.  I have the following statement that I would like to add to:

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

I would like to say if the Company field equals "Value" AND the Acct field equals "Value2" THEN.  Just like that but I do not know the syntax.  Thanks!
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
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
MajorBigDeal earned 500 total points
ID: 34192255
It is tricky to do this in the if statement itself in reporting services.  You would be better off creating a custom function and reference that.
0
 

Author Comment

by:zintech
ID: 34196341
Where would I create the custom function at, in Visual Studio itself?
0
 
LVL 11

Assisted Solution

by:MajorBigDeal
MajorBigDeal earned 500 total points
ID: 34200310
I think it is under the code tab of the report properties - if that doesn't work for you just let me know.
0
 
LVL 7

Expert Comment

by:mr_nadger
ID: 34239595
sorry, I meant a SQL function and call it from a stored proc used as the reports data source
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

734 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