If I do Sum(January Gain) I get values. There are no values for January loss, but when I do Sum(January Gain)- Sum(January Loss) I get blank data. What am I missing?
If I do Sum(January Gain) I get values. There are no values for January loss, but when I do Sum(January Gain)- Sum(January Loss) I get blank data. What am I missing?
Try this:
Sum(nz([January Gain]),0) - Sum(nz([January Loss]),0)
The nz function puts a Zero in if any of your values are Null. Access can then calculate properly.
Let us know if this helps.
Syntax error (comma) in query expression...
Should I go into my query and make the null values for "January loss" 0?
Should I go into my query and make the null values for "January loss" 0?
This didnt work either.
My bad - sorry.
Try this:
Sum(nz([January Gain],0)) - Sum(nz([January Loss],0))
Let me know if that works
To answer your question:
I usually use the Nz()function in my queries so I'm sure that the reports are getting no Nulls.Should I go into my query and make the null values for "January loss" 0?
I would put this:
in a new field in my query in Query Design View.Code:Balance: nz([January Gain],0) - nz([January Loss],0)
Then I would just pull the Balance field from the query into my report.
The only calculations I leave to the reports are usually just the Group Totals and the Grand Totals.