|
-
Aug 6th, 2012, 09:19 AM
#1
Thread Starter
Hyperactive Member
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,""))
-
Aug 7th, 2012, 04:48 AM
#2
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|