A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

null error



 
 
Thread Tools Display Modes
  #1  
Old December 4th, 2008, 10:35 PM posted to microsoft.public.access.tablesdbdesign
cjgav
external usenet poster
 
Posts: 54
Default null error

I have created a db for a service centrei based on northwind my invoices
sometimes only have a labour fee and no parts (products) are used this
expression in the query creates a null error in my invoice report ,
ExtendedPrice: CCur([Products].[UnitPrice]
*[Quantity]*(1-[Discount])/100)*100

Any idea how I could prevent this

  #2  
Old December 5th, 2008, 12:09 AM posted to microsoft.public.access.tablesdbdesign
Allen Browne
external usenet poster
 
Posts: 11,706
Default null error

CCur() doesn't cope with null.

ExtendedPrice: CCur(Nz([Products].[UnitPrice] * [Quantity] * (1 -
[Discount]) /100, 0)) * 100

--
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.

"cjgav" wrote in message
...
I have created a db for a service centrei based on northwind my invoices
sometimes only have a labour fee and no parts (products) are used this
expression in the query creates a null error in my invoice report ,
ExtendedPrice: CCur([Products].[UnitPrice]
*[Quantity]*(1-[Discount])/100)*100

Any idea how I could prevent this


  #3  
Old December 5th, 2008, 11:23 PM posted to microsoft.public.access.tablesdbdesign
cjgav
external usenet poster
 
Posts: 54
Default null error

Thanks thats solved that works a treat

"Allen Browne" wrote:

CCur() doesn't cope with null.

ExtendedPrice: CCur(Nz([Products].[UnitPrice] * [Quantity] * (1 -
[Discount]) /100, 0)) * 100

--
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.

"cjgav" wrote in message
...
I have created a db for a service centrei based on northwind my invoices
sometimes only have a labour fee and no parts (products) are used this
expression in the query creates a null error in my invoice report ,
ExtendedPrice: CCur([Products].[UnitPrice]
*[Quantity]*(1-[Discount])/100)*100

Any idea how I could prevent this



 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:41 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.