Queries - Calculated Field Based On Relationship

Table “Line Items” is related to Table “Expense Groups.” One “Expense Group” has Many “Line Items.”

Line Items has a decimal.

I need to sum the Line Items that are related to the Expense Group with a query.

For example Expense Group “Trip to Las Vegas” has related Line Items of Flight $500, Taxi Cab $50, Dinner $40.

I need to sum the Flight, Taxi Cab, and Dinner, since those are related to the “Trip to Vegas” Expense Group.

Hello,

What names or amounts or number of decimals involved are doesn’t matter much. The concern is a link from the Line Items to the Groups. Here are some sample tables and the SQL with results showing totals for each group:

Top section is ExpenseGroups table, Middle section is LineItems table and the lower section is the Query with results. LineItems are linked to the ExpenseGroups using the expense_group_id field.

Nevermind, I think I understand.