Question Interpreting blanks as zeros?

laxster

Registered User.
Local time
Today, 13:29
Joined
Aug 25, 2009
Messages
145
I was wondering if it's possible to interpret blanks as zeros?

I have many fields which then use expressions to tally them up. I need to use the val of some text fields. There are also number fields which are multiplied by the val in the text fields.

I find that if I don't place a default value to 0 that I get criteria mis-match errors. However, the final output goes to a report, and the report looks unbecoming with the 0s that keep showing up.

Does Access have a way of interpreting the blanks as zeros?
 
Take a look at the Nz() function in help. You can use it in the middle of your expressions to give nulls a default value.
 
It looks like that will do what I need it to do!

Is it possible to make it apply to specific columns without it turning into an expression? I can make it an EXPR if there's no other way, but I'm trying to avoid re-writing the entire query as it already contains many expressions.
 
You can use it at the time you do the evaluation, if you want. Just use Nz(myobjectname, mydefaultvalue) (off the top of my head-your job to look up the syntax) instead of myobjectname.
 

Users who are viewing this thread

Back
Top Bottom