How to use the "Where" option in a totals query

Leebo86

Registered User.
Local time
Today, 05:18
Joined
Dec 20, 2012
Messages
14
Can someone give me an example of how the "Where" option in a totals query is used?

Am I just supposed to choose "Where" and then fill in the criteria line with the appropriate criteria? Or is that separate from how the "Where" option works.
 
Criteria in aggregate queries can be applied in two ways

If you select Where from the drop down and then place the criteria in that column then you get a Where clause that is applied before aggregation.

If you place the criteria in a column with another function selected , say Sum then you get a Having clause applied after aggregation.

So in the first case Where fieldname > 2 means that only records meeting that criteria are selected

Having Sum(fieldn) >2 means that that the sum of all the fieldn must be greater than 2 for the result to be selected.

HTH

Brian
 
Thank you very much. For some reason it's quite difficult to find documentation of that.
 
Indeed it is , it was quite a while before the penny dropped for me, it I was only because I switched to SQL view that it became clear, I should add that you can have both clauses in a query, the Where to Select only the records you want to aggregate and Having to Select only the results you are interested in.

Brian
 

Users who are viewing this thread

Back
Top Bottom