---
title: SQL - Export Transaction to reconcile account Balance
description: VetLinkPro SQL - Export Transaction to reconcile account Balance
---

# VetLink PRO

 Connecting Veterinary Professionals with Smarter Solutions

[Skip to content](https://help.vetlinkpro.com/vetlinkpro/sql-export-transaction-to-reconcile-account-balance#main-content)

English - Australia

Show submenu for translations

![Vetlinkpro - Intergrity - excellence - clarity](https://help.vetlinkpro.com/hs-fs/hubfs/MAIN_2026-1.png?width=528&height=160&name=MAIN_2026-1.png)

Open main navigation

Close main navigation

- English - Australia
  
  Show submenu for translations
- Contact us

 Contact us

 How can we help you?

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

1. [VetLink PRO](https://help.vetlinkpro.com/vetlinkpro)
2. [Support](https://help.vetlinkpro.com/vetlinkpro/support)
3. [Bill](https://help.vetlinkpro.com/vetlinkpro/support#bill)

# SQL - Export Transaction to reconcile account Balance

## v7,v6

select GLL."Trn\_Ref", GLL."Trn\_Date", GLL."Inv\_Type", GLL."Pmt\_Num", GLL."Trn\_Store",

(select BM."Amt\_Due" from "Bill\_Main" BM where BM."Ref\_Number" = GLL."Trn\_Ref" and GLL."Trn\_Source" = 'D') "Left to Pay",

case when GLL."Pmt\_Num" = 3 and "Inv\_Type" \<\> 12 then GLL."Credit\_Amt"  else null END "Debit",

case when GLL."Pmt\_Num" = 3 and "Inv\_Type" = 12 then GLL."Credit\_Amt"  else null END "Debit Acc\_Fee",

case when GLL."Pmt\_Num" = 11 then GLL."Credit\_Amt"  else null END "Credit"

from "General\_Ledger\_Log" GLL

where GLL."Cln\_Num" = :Client/\*Client\*/

and GLL."Trn\_Date" \>= :Date/\*Date\*/ 

and GLL."Pmt\_Num" in (3,11)

and GLL."Trn\_Source" = 'D'

order by GLL."Trn\_Date"

 

//Export this to txt then convert to excel.

//Add Running balance column

//Add a carried forward balance on second line with balance carried forward you are reconciling from

//Add function to calculate running balance: =J2+G3+H3-I3

 

![](https://support.vetlinksql.com/galleryDocuments/edbsn9c0e2a724b14c9cfe67f43b9ceff3ca2680465b696c4940d4ea63f6e7308d8d7a207bd0414f74365f3c1ed05577b9d81?inline=true)

 

//Once all credits applied to owing

//Total of Left to Pay column should equal final running balance IF the date in your export has gone back far enough to include all owing bills.

//Carried forward balance + Total Debit + Total Debit Acc Fee - Credit should equal Running balance.

//Running balance should equal owing amount on client record.  
![](https://support.vetlinksql.com/galleryDocuments/edbsn9c0e2a724b14c9cfe67f43b9ceff3ca2cd11b97fdaeecb2c4ab29cd506ba253ffa9348e14261e83ae3b3dc4e79c32ed5?inline=true)

- [Support](https://help.vetlinkpro.com/vetlinkpro/support#main-content)

    - [Client Portal](https://help.vetlinkpro.com/vetlinkpro/support#client-portal)
    - [Creditors](https://help.vetlinkpro.com/vetlinkpro/support#creditors)
    - [Upgrade](https://help.vetlinkpro.com/vetlinkpro/support#upgrade)
    - [Payments](https://help.vetlinkpro.com/vetlinkpro/support#payments)
    - [Patient](https://help.vetlinkpro.com/vetlinkpro/support#patient)
    - [Product](https://help.vetlinkpro.com/vetlinkpro/support#product)
    - [Xero](https://help.vetlinkpro.com/vetlinkpro/support#xero)
    - [Clinical History](https://help.vetlinkpro.com/vetlinkpro/support#clinical-history)
    - [RDS Setup](https://help.vetlinkpro.com/vetlinkpro/support#rds-setup)
    - [Client](https://help.vetlinkpro.com/vetlinkpro/support#client)
    - [Diary](https://help.vetlinkpro.com/vetlinkpro/support#diary)
    - [Mailers](https://help.vetlinkpro.com/vetlinkpro/support#mailers)
    - [Exports](https://help.vetlinkpro.com/vetlinkpro/support#exports)
    - [Stocktake](https://help.vetlinkpro.com/vetlinkpro/support#stocktake)
    - [Reports](https://help.vetlinkpro.com/vetlinkpro/support#reports)
    - [EOP / Statements](https://help.vetlinkpro.com/vetlinkpro/support#eop-statements)
    - [Eforms / Digital Forms](https://help.vetlinkpro.com/vetlinkpro/support#eforms-digital-forms)
    - [Other](https://help.vetlinkpro.com/vetlinkpro/support#other)
    - [Printing](https://help.vetlinkpro.com/vetlinkpro/support#printing)
    - [Email](https://help.vetlinkpro.com/vetlinkpro/support#email)
    - [Server / Technical](https://help.vetlinkpro.com/vetlinkpro/support#server-technical)
    - [Insurance](https://help.vetlinkpro.com/vetlinkpro/support#insurance)
    - [Bill](https://help.vetlinkpro.com/vetlinkpro/support#bill)
    - [Vac Reminders](https://help.vetlinkpro.com/vetlinkpro/support#vac-reminders)
    - [Online Booking](https://help.vetlinkpro.com/vetlinkpro/support#online-booking)
    - [Mobile Billing](https://help.vetlinkpro.com/vetlinkpro/support#mobile-billing)
    - [Barcoding](https://help.vetlinkpro.com/vetlinkpro/support#barcoding)
    - [SMS](https://help.vetlinkpro.com/vetlinkpro/support#sms)
    - [General Ledger](https://help.vetlinkpro.com/vetlinkpro/support#general-ledger)
    - [Staff](https://help.vetlinkpro.com/vetlinkpro/support#staff)
    - [Telemedicine](https://help.vetlinkpro.com/vetlinkpro/support#telemedicine)
- [Manual](https://help.vetlinkpro.com/vetlinkpro/manual#main-content)

    - [6.1](https://help.vetlinkpro.com/vetlinkpro/manual#6-1)
    - [7.0](https://help.vetlinkpro.com/vetlinkpro/manual#7-0)

[![Vetlinkpro - Intergrity - excellence - clarity](https://help.vetlinkpro.com/hs-fs/hubfs/MAIN_2026-1.png?width=528&height=160&name=MAIN_2026-1.png "Vetlinkpro - Intergrity - excellence - clarity")](https://www.vetlinkpro.com)

<https://www.facebook.com/> <https://www.twitter.com/> <https://www.instagram.com/> <https://podcasts.apple.com/> [mailto:email@email.com](mailto:email@email.com)

Copyright © 2026, VetlinkPRO