null error

C

cjgav

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
 
A

Allen Browne

CCur() doesn't cope with null.

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

cjgav

Thanks thats solved that works a treat

Allen Browne said:
CCur() doesn't cope with null.

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

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

cjgav said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top