Showing Zero's on a report

K

Kay Starnes

Can anyone help me make my report show zero's in a number field on my report?
The table's field is blank therefore the Q returns a blank field.
 
F

Fred

"Blank" = null which means no number has been entered.
Zero = the field has a specific value.

So printing a zero for a field which is null is technically wrong. But.....

If you are considering an untouched field to be a "0" set 0 as the default
value for that field.
 
C

Clifford Bass

Hi Kay,

You could set the control's format to something like:

#,##0;-#,##0;;0

Clifford Bass
 
B

Barry A&P

Kay

Use
=IIf(IsNull([YourField]),"0",[YourField])
as the controls "control source"

use "0" if you want 0 returned or you can put words too like "No Data Entered"

Good luck
Barry
 
F

Fred

Might need saying, if using Barry's method to change the control name if it's
the same as the field name.
 
D

Duane Hookom

I would actually use Clifford's suggestion since it doesn't involve changing
the Control Source.

However, I would change:
=IIf(IsNull([YourField]),"0",[YourField])
to
=IIf(IsNull([YourField]),0,[YourField])
I try to keep the proper data type and "0" is a string which doesn't make
sense.

You could also use the simpler:
=Nz([YourField],0)
or
=Val(Nz([YourField],0))
 

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