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.
> 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
effendi@epitome.com.sg - 14 May 2006 17:22 GMT
Thanks, I'll give it a go.