Results 1 to 3 of 3

Thread: [RESOLVED] rdc Problem dividing

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

    Resolved [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?

  2. #2
    Frenzied Member
    Join Date
    May 06
    Location
    some place in the cloud
    Posts
    1,660

    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 ...

  3. #3
    Hyperactive Member
    Join Date
    Apr 10
    Posts
    299

    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
  •