Problem with SSRS expression

Posted on 2014-08-12
Last Modified: 2014-09-04
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)
Question by:J C
    LVL 47

    Assisted Solution


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

    unless I'm mistaken the wildcard is %
    LVL 27

    Accepted Solution

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    This video discusses moving either the default database or any database to a new volume.

    779 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

    14 Experts available now in Live!

    Get 1:1 Help Now