Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop returning a blank value 2

Status
Not open for further replies.

PavelowFE

Technical User
Jan 13, 2009
39
US
How do I get this (code below) to not output a blank if [Asset Used] does not contain a value?

SELECT DISTINCTROW [Mission Report].[Asset Used], Sum([Mission Report].[# of Aircrew Trained]) AS [Sum Of # of Aircrew Trained]
FROM [Mission Report]
WHERE ((([Mission Report].[Date Tng Completed]) Between #10/1/2008# And #9/30/2009#))
GROUP BY [Mission Report].[Asset Used];

Thanks for the help.

Vince
 
What does "output a blank" mean? If you want to exclude rows where the field is null, add AND [Mission Report].[Asset Used] IS NOT NULL to the WHERE clause.

Cogito eggo sum – I think, therefore I am a waffle.
 
[cheers]

Cogito eggo sum – I think, therefore I am a waffle.
 
Since I'm on a roll and this thing is coming together well,

How do I do the same thing if the [# of Aircrew Trained] is 0? (i.e. If the # of Aircrew Trained is zero, but there is a value for [Asset Used], I don't want it to return anything). I'm sure it's just as easy as the first one, but I just don't have the skills. Sorry.

Thanks again.

Vince
 
AND [Mission Report].[# of Aircrew Trained] <> 0


Unless this field can contain a null (blank).

Cogito eggo sum – I think, therefore I am a waffle.
 
PavelowFE

Why are you thanking Vince. I don't think Vince had anything helpful to say. Instead, you should click the link "Thank genomon for this valuable post". That's what I would do.



-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Do you think that genomon's name is Vince? Nice name, BTW :)

Just kidding - there is not a bit deal to click the thank button :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top