Summinh with If Function

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
 
K

Klatuu

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)
 
J

John Spencer

=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

Similar Threads

Due Dates 3
Summing Groups in Reports 2
Summing groups in a report 1
Excel Excel Formula - IF Function with percentages 1
Calculating an Average 11
IIF Statement Help 2
aged debtors 1
Build search function in to a form 5

Top