Connecting Tech Pros Worldwide Help | Site Map

NULL IS 0

  #1  
Old November 13th, 2005, 05:04 AM
DS
Guest
 
Posts: n/a
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]
  #2  
Old November 13th, 2005, 05:04 AM
Allen Browne
Guest
 
Posts: n/a

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]


  #3  
Old November 13th, 2005, 05:04 AM
DS
Guest
 
Posts: n/a

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Int to Null ? Is possible ? Paperback Writer answers 3 November 17th, 2005 05:02 AM
References for machines where NULL is not zero. pm940@yahoo.com answers 25 November 15th, 2005 04:04 AM
null and NULL: is there any difference? RHNewBie answers 24 November 13th, 2005 07:22 PM
IE SP2 solution for "null is null or not an object" and "broken" insertCell/insertRow putty answers 1 July 23rd, 2005 07:58 PM