Link to home
Start Free TrialLog in
Avatar of SteveL13
SteveL13Flag for United States of America

asked on

Field on report won't display commas

I have a number field on a report set as standard, 0 decimals.  But it will not display the commas.

Here is the control source.  How can I change it to display commas (like for example...  5,250)

=Nz([QtyAvail],0)

--Steve
ASKER CERTIFIED SOLUTION
Avatar of Dale Fye
Dale Fye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This is probably better:

=IIF(IsNull([QtyAvail]), Null, Format([QtyAvail],"0,000") )

mx
no need to use NZ or IsNull

= format([QtyAvail], "0,000")

should be ok, if it is null, then format returns null (or empty string)
But ...

Format(0,"0,000")
Returns 0,000

fyed's solution is probably the best.

mx
I've found that Access frequently fails to correctly interpret the desired datatype returned by the NZ() function, so I normally do this type of explicit typing whenever I use NZ().
Yeah, I guess that was obvious, lol ...

mx