Connecting Tech Pros Worldwide Help | Site Map

NULL IS 0

DS
Guest
 
Posts: n/a
#1: Nov 13 '05
Hi,
Is there anyway to make this Expression cough up a Zero if the field in
this Unbound Text Box is Empty or Null?
Thanks.
DS

CCur([Retail Price]*[Quantity Sold]*(1-[DiscountP])/100)*100-[DiscountD]
Allen Browne
Guest
 
Posts: n/a
#2: Nov 13 '05

re: NULL IS 0


CCur() can't handle the Null, so you will need to use Nz() twice:

CCur(Nz([Retail Price] * [Quantity Sold] * (1 - [DiscountP]) / 100, 0))
* 100 - Nz([DiscountD],0)
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"DS" <bootybox@optonline.net> wrote in message
news:ULXhd.14203$6z2.7657723@news4.srv.hcvlny.cv.n et...[color=blue]
>
> Is there anyway to make this Expression cough up a Zero if the field in
> this Unbound Text Box is Empty or Null?
> Thanks.
> DS
>
> CCur([Retail Price]*[Quantity Sold]*(1-[DiscountP])/100)*100-[DiscountD][/color]


DS
Guest
 
Posts: n/a
#3: Nov 13 '05

re: NULL IS 0


Allen Browne wrote:[color=blue]
> CCur() can't handle the Null, so you will need to use Nz() twice:
>
> CCur(Nz([Retail Price] * [Quantity Sold] * (1 - [DiscountP]) / 100, 0))
> * 100 - Nz([DiscountD],0)[/color]
Allen,
Thank you once again! It works great!
DS
Closed Thread