NZ function

AccessWater

Registered User.
Local time
Today, 13:06
Joined
Jun 14, 2006
Messages
52
I need to calculate a variance between actual and budget. Some projects have only Budget data but not Actual data. When I calculate the variance, it gives me #error.

I used a subreport to get Actuals. The link of this sureport to main report is Project ID. There is always Budget for each project. when there is no match for Actual, there is an empty line in the report.

I used =[Budget]-(NZ[Actual],0) funtion in calculating the variance, it still gives me #error.

Does this have somehting to do with my report structure?

Thank you.
 
There is two different way to handle Nz()... if you want a text string to replace the null, you say Nz(fieldname, text) whereas if you want 0 or other numeric data to replace null, it's Nz(fieldname+0).

That was off the top of my head so my punctuation may be wrong; it's documented in Mircosoft Help.
 
Thank you for your replies. I have followed the instruction from Microsoft help. I think the problem I have is that there may have no "NULL" in some Actuals. I tested a couple of things: In the detail section of the subreport, I used NZ function. If the project has no actual, there should be a "0" intead of blank in the report. However, there is nothing. I suspect my structure of picking up the Actuals was not correct.
 

Users who are viewing this thread

Back
Top Bottom