New to If statements

  • Thread starter Thread starter swillems
  • Start date Start date
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.
 
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 ...
 
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
 
Back
Top