R
Radhika
I have a query where I am trying to calculate the average of two fields. The
two fields of importance are called 'OPSE 10ml' and OPSE 10ml 2', each of
which come from another single query. I am trying to make the query look like
this (in datasheet veiw):
ID # Date Phase OPSE 10ml OPSE 10ml 2 OPSE
10ml Avg
1111 01/01/2001 1 10 10
10
1111 02/01/2001 2 4 6
5
So for each ID# there should be an average OPSE 10ml score. This is the code
i used:
OPSE 10 ml Avg: (Nz([OPSE 10ml])+Nz([OPSE 10ml 2]))/2
This works well when both values of OPSE 10ml and OPSE 10ml 2 are present.
However, if one value (for example, OPSE 10ml) is missing, the expression
causes it to be counted as 0. Therefore, if in phase 2, '4' is missing, the
average will be '3'. However, I would like the average to show up as '6'. How
do I change my expression to exclude a value if it is null, instead of
calculating it as '0'.
Thankyou,
Radhika
two fields of importance are called 'OPSE 10ml' and OPSE 10ml 2', each of
which come from another single query. I am trying to make the query look like
this (in datasheet veiw):
ID # Date Phase OPSE 10ml OPSE 10ml 2 OPSE
10ml Avg
1111 01/01/2001 1 10 10
10
1111 02/01/2001 2 4 6
5
So for each ID# there should be an average OPSE 10ml score. This is the code
i used:
OPSE 10 ml Avg: (Nz([OPSE 10ml])+Nz([OPSE 10ml 2]))/2
This works well when both values of OPSE 10ml and OPSE 10ml 2 are present.
However, if one value (for example, OPSE 10ml) is missing, the expression
causes it to be counted as 0. Therefore, if in phase 2, '4' is missing, the
average will be '3'. However, I would like the average to show up as '6'. How
do I change my expression to exclude a value if it is null, instead of
calculating it as '0'.
Thankyou,
Radhika