Returning a Zero in a Query

D

Debbie Nelson

I'm running a query that totals MTD sales for a
particular time frame and by a sales district. The query
lists sales by district and then ranks the districts. If
there are no sales in a district how can I get the query
to return a zero? I tried to use an IIF statement but am
not sure now to test for a null field.

Thanks

Debbie Nelson
 
F

fredg

I'm running a query that totals MTD sales for a
particular time frame and by a sales district. The query
lists sales by district and then ranks the districts. If
there are no sales in a district how can I get the query
to return a zero? I tried to use an IIF statement but am
not sure now to test for a null field.

Thanks

Debbie Nelson

Look up the Nz function in VBA help.
=Nz([Field1],0), + Nz([Field2],0) + etc.
or
= Sum(Nz([FieldName],0))
 

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