GIDATS4978
Registered User.
- Local time
- Today, 12:32
- Joined
- Mar 8, 2016
- Messages
- 10
I am trying to return all values or both Null and 99 as 0's and then average the 5 fields in the query by the number of fields that have data greater than 0.
My original expression: (Nz([1A],0)+Nz([1B],0)+Nz([1C],0)+Nz([1D],0)+Nz([1E],0))/((IIf(Nz([1A],0)>0,1,0))+(IIf(Nz([1B],0)>0,1,0))+(IIf(Nz([1C],0)>0,1,0))+(IIf(Nz([1D],0)>0,1,0))+(IIf(Nz([1E],0)>0,1,0)))
Which works great...however when I enter 99 in any of the fields it counts 99 in the calculations.
I've tried using the "Or" statement in the expression but couldn't figure it out.
The fields will have data from 0 to 5 or 99 as a "Not-Observed". I want to return all values as their value only if it is Not Null or if it is not 99 (i.e. 1,2,3,4,5 or ">0<99").
I know I could put this range in the Criteria of each field, but the entire query needs to be shown (including all Null's and 99's). That's why I created an expression to get the averages.
Thanks in advance for any assistance.
My original expression: (Nz([1A],0)+Nz([1B],0)+Nz([1C],0)+Nz([1D],0)+Nz([1E],0))/((IIf(Nz([1A],0)>0,1,0))+(IIf(Nz([1B],0)>0,1,0))+(IIf(Nz([1C],0)>0,1,0))+(IIf(Nz([1D],0)>0,1,0))+(IIf(Nz([1E],0)>0,1,0)))
Which works great...however when I enter 99 in any of the fields it counts 99 in the calculations.
I've tried using the "Or" statement in the expression but couldn't figure it out.
The fields will have data from 0 to 5 or 99 as a "Not-Observed". I want to return all values as their value only if it is Not Null or if it is not 99 (i.e. 1,2,3,4,5 or ">0<99").
I know I could put this range in the Criteria of each field, but the entire query needs to be shown (including all Null's and 99's). That's why I created an expression to get the averages.
Thanks in advance for any assistance.