Sum of Multiple Values

paulS30berks

Registered User.
Local time
Today, 06:26
Joined
Jul 19, 2005
Messages
116
I am using the formula:

Normal Pay: Sum(IIf([PAYCODE]="STD" Or [PAYCODE]="PAY_R" Or [PAYCODE]="RATE*",[AMT],0)) .

as an expression and need my query just to pick up one row with a total sum of these values, however I am still receiving 2 or 3 lines of seperate values.

Can anyone help?

Thanks

Paul
 
It's all in the details. (Detail lines, that is.) If you have a query for which you want to form the sum of lines with any of three different values in a given field, you must do this in two steps.

First, write a query that SELECTs the records with any of the matching values in the given field. That's ALL IT DOES.

Second, write a summation query based on the first query to form the sum of the field regardless of the value in the column used as the selector in the first query. This works because a query can be based on a table or on another query. This is sort of like using parentheses in a math expression. First you gather the data (first query) and THEN you can do the sums.
 

Users who are viewing this thread

Back
Top Bottom