Results 1 to 2 of 2

Thread: SSRS Sum and iif problem

Hybrid View

  1. #1
    Hyperactive Member
    Join Date
    Apr 10
    Posts
    298

    SSRS Sum and iif problem

    I have a field "Work_code" which can ent in "0", "1" etc.
    I also have a field "Hours". I want to display all the hours if the work_code ends in "0" and sum them.

    THe expression
    iif(right(Fields!work_code.Value,1)="0",Fields!hours.Value,"")
    displays the hours if the work_code end is "0"

    But the following does not display the sum - I'm not sure why.
    =Sum(iif(right(Fields!work_code.Value,1)="0",Fields!hours.Value,""))

  2. #2
    Hyperactive Member
    Join Date
    Apr 10
    Posts
    298

    Re: SSRS Sum and iif problem

    The problem was because the data contained decimals. The following worked:

    =sum(cdbl(iif(right(Fields!work_code.Value,1)="0",Fields!hours.Value,"0.00")))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •