Sum of values of a field

A

Azhar2008

I am new to MS Access and working on a project.
I have a table Table1 having the fields
ID, Department, Expense, etc.

Each department has many expenses that are listed in this table. I want to
make a query such that all the fields of Table1 are there AND an additional
field should be placed into query such that it shows total expense of that
department of record. The query result should be like this:

ID, Department, Expense, Total Expense, etc.

For example if there is record of Dept1, the Total Expense of Dept 1 should
be displayed in this field.

How should I do that? can any budy help me ?

Thanks
 
M

Michel Walsh

Maybe the easiest way is to make two queries.

The first one, bring the table1, click on the summation button on the
toolbar (the one with a capital sigma, a Greek character which look like a
rotated M) and a new line, total, appear in the grid. Drag the field
department in the grid, keep the proposed Group by. Drag the field Expense,
in the grid, but this time, change the Group By to SUM. Save the query as,
say, q1.


Final query: bring your initial table, and q1. Join them by dragging
department from your table over q1.department. In the grid, drag the fields
you need. That should be it.



Vanderghast, Access MVP
 
A

Azhar2008 via AccessMonster.com

Thank you very much.
I have used this method and got my results.
Thanks again.

Michel said:
Maybe the easiest way is to make two queries.

The first one, bring the table1, click on the summation button on the
toolbar (the one with a capital sigma, a Greek character which look like a
rotated M) and a new line, total, appear in the grid. Drag the field
department in the grid, keep the proposed Group by. Drag the field Expense,
in the grid, but this time, change the Group By to SUM. Save the query as,
say, q1.

Final query: bring your initial table, and q1. Join them by dragging
department from your table over q1.department. In the grid, drag the fields
you need. That should be it.

Vanderghast, Access MVP
I am new to MS Access and working on a project.
I have a table Table1 having the fields
[quoted text clipped - 15 lines]
 

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