How do I create a query against a person and total up the expenses for each person`

  • Thread starter Thread starter effendi
  • Start date Start date
E

effendi

I have a table containing persons and another which has personexpense.
I would like to create a query which does a total for expenses for each
person. How can I do this?

Thanks
 
Make a select query with the two tables joined on the person id.

Select View: Totals from the menu

Change group by under the ExpenseCost field to Sum.

In SQL statement that would be something like

SELECT Persons.PersonName, SUM(PersonExpense.Cost) as TotalExpenses
FROM Persons Inner JOIN PersonExpense
ON Persons.PersonID = PersonExpense.PersonID
GROUP BY Persons.PersonName

Insert your field and table names.
 

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

Back
Top