Solved

How to create If statement in Visual Studio reporting services

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Select2 jquery help 9 45
asp.net bundle 8 36
Open form in the top right hand corner of screen 5 19
Open a word document 23 13
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

19 Experts available now in Live!

Get 1:1 Help Now