• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 355
  • Last Modified:

Problem with SSRS expression

I have a unitprice column. In my report if the prodcode is like "*elev*" I need the unitprice to equal 0.00

Here is the expression I am using. It doesn't work. I don't receive an error, it just seems to be ignored. Is there something wrong with my expression?

=iif(Fields!ProdCode.Value LIKE "*elev*", 0.0,Fields!UnitPrice.Value)
0
J C
Asked:
J C
2 Solutions
 
PortletPaulCommented:
try:

=iif(Fields!ProdCode.Value LIKE "%elev%", 0.0,Fields!UnitPrice.Value)

unless I'm mistaken the wildcard is %

http://msdn.microsoft.com/en-us/library/dd255271.aspx
0
 
planoczCommented:
As far as I know you can not use Like in an expression.
Try :
=IIF(Trim(Fields!ProdCode.Value) = "eleven",Fields!UnitPrice.Value,  0.0)

If you have to use Like then you will have to do it in a Stored procedure.
Then the report will only show what you are looking for.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

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