New to If statements

S

swillems

I have a query with service numbers and volumes. What I need is if the
service number = 107, 109, or 105, sum volumes., otherwise show 0.
 
B

Bob Barrows

swillems said:
I have a query with service numbers and volumes. What I need is if
the service number = 107, 109, or 105, sum volumes., otherwise show 0.

select ..., sum(iif([service number] in (107,109,105),volumes,0) as
SumOfVolumes ...
 
J

John Spencer

PERHAPS you want.

SUM(IIF([ServiceNumber] in (105,107,109),[Volume],Null))

Difficult to say without more detail on what you are attempting to do.n

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 

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