Apply conditions to totals row in query

Kozbot

Registered User.
Local time
Today, 00:03
Joined
Jan 16, 2013
Messages
110
Hello

I have a parameter query with a totals row that displays averages. Is there a way to have the average row use only specific records in its calculation based on one of the field's values WHILE still displaying all the records returned by the query.

I want only data that has a "YES" value used in the average while still displaying the records marked as "NO"
 
Depending on exactly what it is you're doing, you might be able to use an IIf statement in the calculation, something like;

IIf([SomeField] = "Yes", YourCalculationHere, "")

Or, you might use DAvg

DAvg("[SomeField]", "[SomeTable]", "[SomeOtherField] = 'Yes'")
 

Users who are viewing this thread

Back
Top Bottom