calculated field doesn't show the correct data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have 3 fields in a query and in a report: Aug, FAug, and AugP.
In the query AugP is being calculated as follows:
=IIf(nz([FAug])<>0,nz([Aug])/nz([FAug]),IIf(nz([Aug])>0,1,0)).
So, if Aug > 0 and FAug = 0 or Null it should be 1 (or 100%).
The query shows it correctly as 1. But, in the report it appears as 0 (0.00%).
Even when I copy this formula in the report AugP field it's 0 anyway.

Could anybody advise anything about how to fix it?

Thanks
 
Some additional info:
When I change the format for the AugP to the General number it appears
correctly as 1 (in case of Aug>0 and FAug =0).
 
I could be off here, but it does not look like you used the Nz function
properly. You do not tell it what to substitte for a null value...

nz([FAug],????)

???? should contain your substitute value.


Does is assume "0" if you leave out that argument?

Rick B



Alex said:
Some additional info:
When I change the format for the AugP to the General number it appears
correctly as 1 (in case of Aug>0 and FAug =0).

Alex said:
I have 3 fields in a query and in a report: Aug, FAug, and AugP.
In the query AugP is being calculated as follows:
=IIf(nz([FAug])<>0,nz([Aug])/nz([FAug]),IIf(nz([Aug])>0,1,0)).
So, if Aug > 0 and FAug = 0 or Null it should be 1 (or 100%).
The query shows it correctly as 1. But, in the report it appears as 0 (0.00%).
Even when I copy this formula in the report AugP field it's 0 anyway.

Could anybody advise anything about how to fix it?

Thanks
 
Thanks everybody. It's done.
The miracle was that the textbox for this field was too small and the first
number didn't appear.

Alex said:
Some additional info:
When I change the format for the AugP to the General number it appears
correctly as 1 (in case of Aug>0 and FAug =0).

Alex said:
I have 3 fields in a query and in a report: Aug, FAug, and AugP.
In the query AugP is being calculated as follows:
=IIf(nz([FAug])<>0,nz([Aug])/nz([FAug]),IIf(nz([Aug])>0,1,0)).
So, if Aug > 0 and FAug = 0 or Null it should be 1 (or 100%).
The query shows it correctly as 1. But, in the report it appears as 0 (0.00%).
Even when I copy this formula in the report AugP field it's 0 anyway.

Could anybody advise anything about how to fix it?

Thanks
 
Back
Top