Zero instead of null in query

  • Thread starter Lori2836 via AccessMonster.com
  • Start date
L

Lori2836 via AccessMonster.com

Good morning. I would like the Uncosted Qty and Uncosted Value to show up
as zeros, when this query is run, instead of nothing. I'm pretty sure I
need to add the Nz, but not sure how it should be added. Below is the code.


SELECT Sum([OPS Numbers].Qty) AS [Uncosted Qty], Sum([OPS Numbers].Value) AS
[Uncosted Value], [OPS Numbers].Gross
FROM [OPS Numbers]
GROUP BY [OPS Numbers].Gross, [OPS Numbers].Costed, [OPS Numbers].Type
HAVING ((([OPS Numbers].Gross)<>"credit") AND (([OPS Numbers].Costed) Like
"Uncosted") AND (([OPS Numbers].Type) Like "N"));


Thanks!
Lori
 
V

vanderghast

SELECT Nz(Sum([OPS Numbers].Qty),0) AS [Uncosted Qty],
Nz(Sum([OPS Numbers].Value),0) AS[Uncosted Value],
[OPS Numbers].Gross
FROM [OPS Numbers]
GROUP BY [OPS Numbers].Gross, [OPS Numbers].Costed, [OPS Numbers].Type
HAVING ((([OPS Numbers].Gross)<>"credit") AND (([OPS Numbers].Costed) Like
"Uncosted") AND (([OPS Numbers].Type) Like "N"));




Vanderghast, Access MVP
 
L

Lori2836 via AccessMonster.com

Thank you!

SELECT Nz(Sum([OPS Numbers].Qty),0) AS [Uncosted Qty],
Nz(Sum([OPS Numbers].Value),0) AS[Uncosted Value],
[OPS Numbers].Gross
FROM [OPS Numbers]
GROUP BY [OPS Numbers].Gross, [OPS Numbers].Costed, [OPS Numbers].Type
HAVING ((([OPS Numbers].Gross)<>"credit") AND (([OPS Numbers].Costed) Like
"Uncosted") AND (([OPS Numbers].Type) Like "N"));

Vanderghast, Access MVP
Good morning. I would like the Uncosted Qty and Uncosted Value to show
up
[quoted text clipped - 12 lines]
Thanks!
Lori
 

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