Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 887
  • Last Modified:

How to create If statement in Visual Studio reporting services

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
zintech
Asked:
zintech
  • 2
2 Solutions
 
MajorBigDealCommented:
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
 
zintechAuthor Commented:
Where would I create the custom function at, in Visual Studio itself?
0
 
MajorBigDealCommented:
I think it is under the code tab of the report properties - if that doesn't work for you just let me know.
0
 
mr_nadgerCommented:
sorry, I meant a SQL function and call it from a stored proc used as the reports data source
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now