Forum Discussion

Jeff2Jets's avatar
Jeff2Jets
Icon for Helper III rankHelper III
2 years ago
Solved

How to total values in one table from another

I have two tables. One is named 'Mailbox' and the other is named 'Folder'. They both have a column named 'Name' and there is a one to many relationship between 'Mailbox' to 'Folder' using the 'Name' column. There are multiple rows in the 'Folder' table for the same value in the 'Name' column and each row in the 'Folder' table has a numeric column named 'Messages', which contains the # of messages for each folder. I would to create a column within the 'Mailbox' table that represents the sum of all rows in the 'Folder' table for the 'Messages' column.

Here is an example rows in the 'Folder' table:

Name            Folder        Messages

John Smith    \Drafts                 10

John Smith    \Inbox                  20

John Smith    \Sent Items          30

 

In the 'Mailbox' table, I want to create a column named 'Messages' that has a value of 60 (10 + 20 + 30).

Thank you!