Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Show total of matching records from related table

Featured Replies

  • Newbies

I have a database for tracking budgets, amount spent, and balance. I have a layout that I show information about each account. I want to have a field that will total all amounts written out of that specific account. How can I show that amount in a specific field. For example I have an account for the warehouse supplies. I want to have a field that shows a total of all the purchase orders that was written out of warehouse supplies.

budget_info.png

If you have stored the accountID in the purchase orders table, then

sum ( PurchaseOrders::Amount )

  • Author
  • Newbies

The account number is stored in the purchase order. The purchase order is divided into 2 tables, purchase order info and items purchased. Both tables have the account number stored. So i assume I would want to sum the purchased items correct?

I don't think that's necessary, anyway it would require you to store the account ID in PO Items. See sample: you can total the PO totals.

SumOverPOs.fp7.zip

  • Author
  • Newbies

Thanks for the help, but thats not what I'm really looking for. I have that part working ok. The screen I show above is a seperate table listing all the accounts. I want to show the amount spent out of individual accounts not the purchase order. The items sold are in their own table and it has the acocunt number in that table.

The items sold are in their own table and it has the acocunt number in that table.

All right, then you can sum over the items

sum ( POItems::amount )

the result will be the same as in my sample (see the Client layout: shows totals over all POs for that client). What I attempted to show was you can see the grand total over all POs even when the Account ID is not stored in the items.

  • Author
  • Newbies

Do I have to have check to make sure the account number on the po items match the record in the account list, example

if (account list::acct_rel = po items::account rel (sum price); 0)

no, that's not necessary.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.