Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2010
    Posts
    32

    Unanswered: Averaging 2 fields in a form

    I now have a different problem

    When I got to average the two fields generated I get an error.

    The original code was something like

    TOTALPERCENT = (Nz([WOAVG], 0) + Nz([PMSAVG], 0) / 2)

    But this doesn't work properly if one of the fields is 0 so I need to figure out a way to do it even if one of the fields is 0

    Now I am trying

    TOTALPERCENT = Avg(Nz([WOAVG], 0) + Nz([PMSAVG], 0))

    but it takes me to the event code and highlights Avg I do not understand why it doesn't work

    Please advise

  2. #2
    Join Date
    Sep 2010
    Posts
    32
    TOTALPERCENT = (Nz([WOAVG], 0) + Nz([PMSAVG], 0)) / (2 - IIf(IsNull([WOAVG]), 1, 0) - IIf(IsNull([PMSAVG]), 1, 0))


    Tried this also which seems most logical to me

Posting Permissions

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