Connecting Tech Pros Worldwide Help | Site Map

NULL IS 0

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 13th, 2005, 04:04 AM
DS
Guest
 
Posts: n/a
Default NULL IS 0

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, 04:04 AM
Allen Browne
Guest
 
Posts: n/a
Default 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, 04:04 AM
DS
Guest
 
Posts: n/a
Default 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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.