Summinh with If Function

  • Thread starter Thread starter WorkRelated
  • Start date Start date
W

WorkRelated

I have a report that shows the start date and finish date of a job and the
contract value.

I want to create a sum in the report footer that adds the contract value if
the start date and end date fall within the same month, as I am fairly new to
access I am not sure how to set this up. Please help. Thanks
 
Pecoflyer's response is an Excel answer.

There is no SumIf in Access, but you could use an IIf to do that:

=Sum(IIf(Month([StartDate) = Month([EndDate]), [ContractValue], 0)
 
=Sum(IIF(Format(StartDate,"yymm")=Format(EndDate,"yymm"),ContractValue,0))

John Spencer
Access MVP 2002-2005, 2007-2009
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

Back
Top