Many thanks to those who continue to make my job more easier and help me learn new programming skills!!!
I have a totals query that has calculated field which does not work if one of the fields it is based on is null. I created a work around (see below).
My question is: is this a good practice or will it blow up on me some time down the road!
1. This is the calculated field:
Percent: [Total Yes]/(([Num Recs]*10)-([NA]))
However, if NA is null, the calculation fails.
2. This is the field I created:
NA0: IIf([Total NA] Is Null,0,[Total NA])
3. then changed the calculated field to:
Percent: [Total Yes]/(([Num Recs]*10)-([NA0]))
This does work but I am concerned that it is a work around that may not be stable!!
Thanks.
I have a totals query that has calculated field which does not work if one of the fields it is based on is null. I created a work around (see below).
My question is: is this a good practice or will it blow up on me some time down the road!
1. This is the calculated field:
Percent: [Total Yes]/(([Num Recs]*10)-([NA]))
However, if NA is null, the calculation fails.
2. This is the field I created:
NA0: IIf([Total NA] Is Null,0,[Total NA])
3. then changed the calculated field to:
Percent: [Total Yes]/(([Num Recs]*10)-([NA0]))
This does work but I am concerned that it is a work around that may not be stable!!
Thanks.