I want to add up numbers of selected rows

G

Guest

I want to add numbers of rows of same field. I have two fields - Department
and Total Charges. I want the total charges for one department. Presently
there are many rows of same department with total charges. I want to sum all
the charges in one cell for one department.
For Example:
I have 10 entries for Cardiology Department and 10 entries for total charges
against it. I want just one row of the cmombinatin of both ie. against
cardiology department only one total charge should appear.

I will appreciate your help.
 
J

Jeff Boyce

Hetal

I may not be visualizing your data structure. From your initial
description, it sounds like you have a two-field table, with [Department]
and [Total Charges]. And you have multiple rows with the same [Department].

If you want to total by all (unique) [Department] values, you can use a
Totals query.

Open a query in design mode and add the table and two fields. Click on the
Totals toolbar button. Use "GroupBy" under [Department] and "Sum" under
[Total Charges]. Run it.

Or have I misunderstood?

Regards

Jeff Boyce
<Office/Access MVP>
 
J

John Vinson

I want to add numbers of rows of same field. I have two fields - Department
and Total Charges. I want the total charges for one department. Presently
there are many rows of same department with total charges. I want to sum all
the charges in one cell for one department.
For Example:
I have 10 entries for Cardiology Department and 10 entries for total charges
against it. I want just one row of the cmombinatin of both ie. against
cardiology department only one total charge should appear.

I will appreciate your help.

Create a Query based on your table. Select the Department and the
charges field.

Change it to a Totals query by clicking the Greek Sigma icon on the
toolbar.

Change the default Group By under the Charges field to Sum.

Open the query by clicking the datasheet icon on the left end of the
toolbar, or base a Form or Report on it.

John W. Vinson[MVP]
 

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