---
title: Trial Balance report is not balanced
description: "If the Trial Balance report has numerical information that is different from what's expected, there's a few solutions you can try before contacting support. Tips for any database-level changes: Runnin"
---

[Skip to content](https://cs.geminilogic.com/en/manual/trial-balance-report-is-not-balanced#main-content)

English

Show submenu for translations

[New Ticket](https://cs.geminilogic.com/en/manual/kb-tickets/new?hsLang=en) [Customer portal](https://cs.geminilogic.com/tickets-view?hsLang=en)

![Gemini-Logic-Logo (1).png\]](https://cs.geminilogic.com/hs-fs/hubfs/Gemini-Logic-Logo%20(1).png?height=40&name=Gemini-Logic-Logo%20(1).png)

- Home
- Products
- Pricing
- Blog
- Company

Open main navigation

Close main navigation

- Home
- Products
- Pricing
- Blog
- Company
- English
  
  Show submenu for translations
- [New Ticket](https://cs.geminilogic.com/en/manual/kb-tickets/new)
- [Customer portal](https://cs.geminilogic.com/tickets-view)
- [Go to Gemini Logic](https://www.geminilogic.com/)

[Go to Gemini Logic](https://www.geminilogic.com/)

 Search the User Manual

- There are no suggestions because the search field is empty.

1. [User Manual](https://cs.geminilogic.com/en/manual?hsLang=en)
2. [Spire Systems - General Knowledge Base](https://cs.geminilogic.com/en/manual/spire-systems-general-knowledge-base?hsLang=en)
3. [Spire Administration - General Ledger](https://cs.geminilogic.com/en/manual/spire-systems-general-knowledge-base?hsLang=en#spire-administration-general-ledger)

# Trial Balance report is not balanced

If the Trial Balance report has numerical information that is different from what's expected, there's a few solutions you can try before contacting support.

**Tips for any database-level changes:**

1. Make a backup (snapshot) of the live database and restore it to a new company/database entry for testing. 
     - You can test out any SQL/database changes on a test environment before making changes to the live environment.
     - At a minimum, use the Spire desktop app to test out the problem(s) that should be fixed, as well as common workflows related to any updated tables.
2. After making changes at the database level, be sure to restart the PostgreSQL and Spire API services (in the Components Services app) in order to refresh any stale data. 
     - If your test environment uses the same PostgreSQL and/or Spire server as the live environment, make sure end-users are logged-out of the live system and are aware of the restart.
     - It's recommended to use a separate PostgreSQL and Spire server for the test environment if possible (even if you don't have another PC, perhaps a Hyper-V virtual machine can be used).
3. When it comes time to update the live database, be sure the end users are aware of this.  Schedule a time when all end users can be logged-out for some relevant duration while you apply the fix.

**Running SQL scripts **(on your company database)

1. On the server PC, run the pgAdmin app.
2. Double-click/open the server entry, open the list of databases, and select the correct database.
3. Click the "SQL" button up top to load the query tool (make sure after it loads that the correct database is specified):
   
   [![](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/13067559913/original/HAh8dvQnjhH2XCZ9N-xmUxrfmsexN-D3aQ.png?1557414475)](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/13067559913/original/HAh8dvQnjhH2XCZ9N-xmUxrfmsexN-D3aQ.png?1557414475)
4. Paste/type the SQL script into the "SQL Editor" text area.
5. Run the script by pressing the F5 key or clicking the "Play" (![](https://s3.amazonaws.com/cdn.freshdesk.com/data/helpdesk/attachments/production/13067559948/original/au4dAReB9Upm_krdBzEuDo0IJV_wBmjxiw.png?1557414507)) button. 
     - Note that if you only wanted to run a portion of the script, you can highlight the portion desired to be run before running it.  Or, simply comment-out the unwanted lines/parts by prefixing them with two dashes (for example, the line "-- update table..." will not be run and will appear in a different colour).

#### Step-by-step guide

**Solution 1 - Run the Re-balancing scripts**

1. See the "**Running SQL scripts**" section for instructions on applying scripts to the database.
2. Apply the following SQL script to the company database:
   
   UPDATE gl\_accounts  
   SET last\_year = '{0.00,0,0,0,0,0,0,0.00,0,0,0,0,0}',  
   this\_year = '{0.00,0,0,0,0,0,0,0.00,0,0,0,0,0}',  
   next\_year = '{0.00,0,0,0,0,0,0,0.00,0,0,0,0,0}',  
   foreign\_last\_year = '{0.00,0,0,0,0,0,0,0.00,0,0,0,0,0}',  
   foreign\_this\_year = '{0.00,0,0,0,0,0,0,0.00,0,0,0,0,0}',  
   foreign\_next\_year = '{0.00,0,0,0,0,0,0,0.00,0,0,0,0,0}';
   
   UPDATE gl\_accounts AS a SET  
   last\_year = r.last\_year,  
   this\_year = r.this\_year,  
   next\_year = r.next\_year,  
   foreign\_last\_year = r.frn\_last\_year,  
   foreign\_this\_year = r.frn\_this\_year,  
   foreign\_next\_year = r.frn\_next\_year  
   FROM gl\_reallocate\_balances() AS r  
   WHERE a.division = r.division  
   AND a.account\_no = r.account\_no  
   AND a.currency = r.currency;

**Solution 2 - Update any incorrect Opening Balances**

1. Run the Spire desktop app and go to the General Ledger.
2. From the Accounts tab, run/print the "GL Open Balance check" report with the printer icon.  Note that if the numbers are hard to read, preview the report and export it to an MS Excel spreadsheet.
3. If the base-currency total isn't zero, you'll have to make some changes at the database level.  Most likely, some accounts weren't balanced before closing-off the last fiscal year.
4. Note that you should contact the company accountant/controller/bookkeeper regarding proper account balances.
5. Once you know the correct balances, refer to section "**Running SQL scripts**" regarding running scripts on the database.
6. You need to change incorrect gl\_accounts.opening\_balance values to be what they should have been before closing the previous year.   
     - The same goes for gl\_accounts.foreign\_opening\_balance values if you are changing a non-base-currency account.
     - Note that base-currency accounts are denoted by an empty string in the currency column of the gl\_accounts table.

1. - Example 1 - update simple base-currency account  
       update gl\_accounts set opening\_balance = 5544.33 where account\_no = '12321' and currency = '';

1. - Example 2 - update non-base-currency account:
       
       update gl\_accounts set opening\_balance = 5544.33, foreign\_opening\_balance = 4654.20 where account\_no = '12321' and currency = 'USD';
     - Example 3 - update base-currency account in multi-division company:
       
       update gl\_accounts set opening\_balance = 5544.33 where account\_no = '12321' and currency = '' and division = '001';
2. Follow the "**Solution 1**" section to re-balance any imbalanced accounts.

**Solution 3 - Balance any imbalanced transactions **

1. Run the Spire desktop app and go to the General Ledger → Transactions tab.
2. Click the printer icon, check the "GL Journal Transaction" report and click "Preview".  This will run a report for every transaction in the database.
3. Click the "Find" button at the top and type in "Balance problem" without the quotes, then click "Find Next".
4. If the text is found then it will be directly below a transaction where the debits and credits do not balance.
5. Decide what needs to be fixed in the transaction (Spire has no way of knowing) from the Controller, Accountant, Bookkeeper, Owner or source documents.
6. Print the page and add your notes about what needs to be fixed.
7. Click "Find Next" and repeat steps 4-7 until no more instances are found.
8. See the section "**Running SQL scripts**" for information regarding updating data at the database level.
9. Correct the value(s) in the database (with update statements) on the applicable row(s) in gl\_transactions table. 
     - Note that the currency column will have an empty string for base-currency transactions.
     - Base-currency transactions only care about the debit\_amt/credit\_amt columns.
     - Non-base-currency transactions care about the debit\_amt/credit\_amt and frn\_debit\_amt/frn\_credit\_amt columns.
     - When updating records, try to use the "id" column's value in the "where" clause to ensure you are only updating the one exact row that you intend to update.
     - If you are having trouble with the SQL details here, please contact your partner (for Spire direct-support subscribers) or Spire support if you are a partner/developer.

1. Follow the "**Solution 1**" section to re-balance any imbalanced accounts.

- [Spire Systems - General Knowledge Base](https://cs.geminilogic.com/en/manual/spire-systems-general-knowledge-base?hsLang=en#main-content)

    - [Tips and Tricks](https://cs.geminilogic.com/en/manual/spire-systems-general-knowledge-base?hsLang=en#tips-and-tricks)
    - [Spire Administration - General Ledger](https://cs.geminilogic.com/en/manual/spire-systems-general-knowledge-base?hsLang=en#spire-administration-general-ledger)
    - [Spire Administration - Sales](https://cs.geminilogic.com/en/manual/spire-systems-general-knowledge-base?hsLang=en#spire-administration-sales)
    - [Spire Administration - Inventory](https://cs.geminilogic.com/en/manual/spire-systems-general-knowledge-base?hsLang=en#spire-administration-inventory)
- [Analytics for Spire](https://cs.geminilogic.com/en/manual/analytics-for-spire?hsLang=en)
- [Spire User Manual - System Overview](https://cs.geminilogic.com/en/manual/spire-user-manual-system-overview?hsLang=en)
- [Spire User Manual - User Settings](https://cs.geminilogic.com/en/manual/spire-user-manual-user-settings?hsLang=en)
- [Spire User Manual - Vendors](https://cs.geminilogic.com/en/manual/spire-user-manual-vendors?hsLang=en)
- [Spire User Manual - Inventory](https://cs.geminilogic.com/en/manual/spire-user-manual-inventory?hsLang=en#main-content)

    - [Pricing](https://cs.geminilogic.com/en/manual/spire-user-manual-inventory?hsLang=en#pricing)
- [Spire User Manual - Price Matrix](https://cs.geminilogic.com/en/manual/spire-user-manual-price-matrix?hsLang=en)
- [Spire User Manual - Purchase Orders](https://cs.geminilogic.com/en/manual/spire-user-manual-purchase-orders?hsLang=en)
- [Spire User Manual - Sales Orders](https://cs.geminilogic.com/en/manual/spire-user-manual-sales-orders?hsLang=en)
- [Spire User Manual - Keyboard Shortcuts](https://cs.geminilogic.com/en/manual/spire-user-manual-keyboard-shortcuts?hsLang=en)
- [Spire User Manual - Company Settings](https://cs.geminilogic.com/en/manual/spire-user-manual-company-settings?hsLang=en)
- [Spire User Manual - New Instal/Company Setup](https://cs.geminilogic.com/en/manual/spire-user-manual-new-instal-company-setup?hsLang=en)
- [Spire User Manual - General Ledger](https://cs.geminilogic.com/en/manual/spire-user-manual-general-ledger?hsLang=en)
- [Spire User Manual - Accounts Receivable](https://cs.geminilogic.com/en/manual/spire-user-manual-accounts-receivable?hsLang=en)
- [Spire User Manual - Accounts Payable](https://cs.geminilogic.com/en/manual/spire-user-manual-accounts-payable?hsLang=en)
- [Spire User Manual - Payroll](https://cs.geminilogic.com/en/manual/spire-user-manual-payroll?hsLang=en)
- [Spire User Manual - Production Manager](https://cs.geminilogic.com/en/manual/spire-user-manual-production-manager?hsLang=en)
- [Spire User Manual - Service Manager](https://cs.geminilogic.com/en/manual/spire-user-manual-service-manager?hsLang=en)
- [Spire User Manual - User Defined Fields](https://cs.geminilogic.com/en/manual/spire-user-manual-user-defined-fields?hsLang=en)
- [Spire User Manual - Job Costing](https://cs.geminilogic.com/en/manual/spire-user-manual-job-costing?hsLang=en)
- [HubSpot](https://cs.geminilogic.com/en/manual/hubspot?hsLang=en#main-content)

    - [Updates](https://cs.geminilogic.com/en/manual/hubspot?hsLang=en#updates)
- [Gemini Logic](https://cs.geminilogic.com/en/manual/gemini-logic?hsLang=en)
- [Shipping](https://cs.geminilogic.com/en/manual/shipping?hsLang=en)
- [Sales Taxes](https://cs.geminilogic.com/en/manual/sales-taxes?hsLang=en)
- [Spire User Manual](https://cs.geminilogic.com/en/manual/spire-user-manual?hsLang=en#main-content)

    - [Customers](https://cs.geminilogic.com/en/manual/spire-user-manual?hsLang=en#customers)

- Home
- Products
- Pricing
- Blog
- Company

[![Chill listening crop-3](https://cs.geminilogic.com/hs-fs/hubfs/Gemini%20Logic%20-%20Black-1.png?width=77&height=24&name=Gemini%20Logic%20-%20Black-1.png "Chill listening crop-3")](https://www.geminilogic.com/)

 Gemini Logic

<https://www.linkedin.com/company/2460588> <https://www.youtube.com/user/GeminiLogicInc/featured> <https://twitter.com/gemini_logic>

Copyright © 2026, 9858733 Canada Inc. (Gemini Logic)