How to obtain the balance of a ledger account
I need to obtain the balance of a ledger account at a specific date, as does the report "General Ledger" of SAP Business One.
Currently, I obtain the balance at a specific date with the following calculation,
Select (Debit - Credit) SALDO
Where dRefDate < "Specific Date" and Account = "Specific Account"
But, the DataBase is very huge, has a lot of records.
I need to know if it's posibble to obtain this balance in a way more efficient.