Solved

How to create If statement in Visual Studio reporting services

Posted on 2010-11-22
4
856 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

863 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

25 Experts available now in Live!

Get 1:1 Help Now