Nz Function

G

Guest

Hello,

I have a query to get inventory item sold total in a period.

i.e. total 5 items from item1 to item5

from 1/1/2004 to 12/31/2004 sold following items
item1 10
item3 23
item5 12

from 1/1/2005 to 12/31/2005 sold following items
item1 15
item2 22

I create a new query to find out item sold 2004, 2005 and total
The total will add 2004 and 2005
but the result is
item1 10 15 25
item2 22
item3 23
item4
item5 12

then I use Nz(Sumof2004,0) or Nz([Sumof2004],0) in the 2004 field
always say Nz compile error

Thanks
 
G

Guest

To get the 0 , use the NZ function inside the group by query, and not on the
final resault

Select Sum(Nz([FieldName],0)) As Sumof2004 From TableName
 

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

Similar Threads


Top