Jump 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.

Summing debits/credits in simple general ledger?

Featured Replies

  • Newbies

Hi, this is my first post here. I tried to see if this question has been addressed before but if so I couldn't find it.

Anyway, I'm trying to make the simplest flat-file general ledger but I can't figure out how to sum the accounts.

The database is simple: Each record has just the date, amount, debit account, credit account, and description. So far so good.

But I don't know how to sum each account. The problem is that for a given set of records for a given account, some of the amounts will be debits and some will be credits, and I don't know how to check for each one. I can't just sum the Amount field -- some of those entries need + values and some need - values depending on whether they're debits or credits.

The only solution I know of is to search for a debit account, record the total on a piece of paper, then search for a credit account, and subtract its total from the first total. Seems like that's a waste of owning a computer, though.

I don't mind creating a separate script for each and every account. I just don't know how to set it up to even write the first script.

Thanks very much for your help.

The easiest solution is to create a related accounts file. This file would have one record for each account and would have two relationships. One relationship (let's call it "Credit") from the account field back to the credit account field, and one relationship (let's call it "Debit") from the account field back to the debit account field. Then, you can do summaries easily in the account file. A calculated field in the accounts file with this formula will give you an account balance:

Sum(Debit::Amount)-Sum(Credit::Amount)

You can also place a portal based on these relationships, on the layout in your accounts file and view all the transactions records pertaining to the account.

Create an account or sign in to comment

Important Information

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

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.