calculated field doesn't show the correct data

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
 
G

Guest

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).
 
R

Rick B

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top