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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Zero instead of null in query



 
 
Thread Tools Display Modes
  #1  
Old August 19th, 2009, 02:58 PM posted to microsoft.public.access.queries
Lori2836 via AccessMonster.com
external usenet poster
 
Posts: 44
Default Zero instead of null in query

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

--
Message posted via http://www.accessmonster.com

  #2  
Old August 19th, 2009, 03:19 PM posted to microsoft.public.access.queries
vanderghast
external usenet poster
 
Posts: 593
Default Zero instead of null in query

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


"Lori2836 via AccessMonster.com" u23986@uwe wrote in message
news:9ad4f4918c815@uwe...
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

--
Message posted via http://www.accessmonster.com


  #3  
Old August 19th, 2009, 04:02 PM posted to microsoft.public.access.queries
Lori2836 via AccessMonster.com
external usenet poster
 
Posts: 44
Default Zero instead of null in query

Thank you!


vanderghast wrote:
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


--
Message posted via http://www.accessmonster.com

 




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 08:53 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.