Sum by name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table that has some information regarding employees. I am trying to
sum up the financial information by the employee name. I have 3 fields that
have such thing as dues, initiation, and hours for the period. I want a
query that sums the dues, initiation, and hours based on the name of the
employee. I'm not sure where to go in the sql. I have sum dues, initiation
and hours, but of course get three lines in the query, I would like them all
to appear on one line with the employees name. Thanks
 
Create a Select query. In the query put the 4 fields you need and make it a
totals query:
Employee Name - Group By
Dues - Sum
Initian - Sum
Hours - Sum
 
That works fine, thanks, except that I have other information there that I
wanted to use in my report. Is there another way to keep it all together
without getting too many queries?
 
Well, you didn't say that before. The problem is that in a totals query,
each field has to be an domain aggrate function. This creates a problem,
because the additional information will create a separate row for each change
in data. So, this may not be the right approach. You may want to consider
doing the summing at the report level. Make the employee a group level, then
in the fields you want to sum, use the Running Sum over Group.
 
I have a table that has some information regarding employees. I am trying to
sum up the financial information by the employee name.

Note that names are NOT unique. Do you not have a unique employee ID?
I'd be inclined to group by that instead of by name.
I have 3 fields that
have such thing as dues, initiation, and hours for the period.

Are these in three separate *FIELDS*, or three different *RECORDS*?
I want a
query that sums the dues, initiation, and hours based on the name of the
employee. I'm not sure where to go in the sql. I have sum dues, initiation
and hours, but of course get three lines in the query, I would like them all
to appear on one line with the employees name. Thanks

Please post a fuller description of your table structure, and the SQL
view of the query that's giving you three lines.

John W. Vinson[MVP]
 
Back
Top