|
-
Sep 20th, 2012, 10:40 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] rdc Problem dividing
=iif(Fields!job_number.Value=0,"",Fields!job_number.Value/Fields!mast_jobno.Value)
I am dividing job_number by mast_jobno.
As this could give an error with a divide by zero, I'm using an iif statement to test for zero.
But I'm getting an error if I divide by zero.
What am I doing wrong?
-
Sep 20th, 2012, 06:42 PM
#2
Re: rdc Problem dividing
That's because IIF evaluates both, true & false expressions, before resolve
I would try an If Then Else
JG
... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...
-
Sep 21st, 2012, 03:54 AM
#3
Thread Starter
Hyperactive Member
Re: rdc Problem dividing
I coudn't find if then else.
I used a nested iif and it worked.
=IIf(Fields!mast_jobno.Value=0,"",Fields!job_number.Value/IIf(Fields!mast_jobno.Value=0,1,Fields!mast_jobno.Value))
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
|