Show only sum values that exceed a certain total

T

Trudy

I am trying to produce a report where I have a sum for a
collective amount (number field) and that will print only
when greater that a certain amount.

Anyone have an expression that will allow me to weed out
the lower numbers?

For example, I have a sum of all contributions to our
agency, I want to only print those over $5000 in the sum
of their contributions.

Thanks in advance for any help!
Trudy
 
J

John Vinson

I am trying to produce a report where I have a sum for a
collective amount (number field) and that will print only
when greater that a certain amount.

Anyone have an expression that will allow me to weed out
the lower numbers?

For example, I have a sum of all contributions to our
agency, I want to only print those over $5000 in the sum
of their contributions.

If you create a Totals query grouping by contributor and summing
contributions, you can put a criterion of >5000 on the sum field. The
SQL will be something like

SELECT <ContributorFields>, Sum([Contribution])
FROM Contributions
GROUP BY <ContributorFields>
HAVING Sum([Contribution]) > 5000;

The HAVING operator differs from the WHERE operator in that it applies
*after* the Totals operations have been done; WHERE filters the
records which go into the calculation before the summing takes place.
 

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