---
title: "Lusid.Abor.TrialBalance"
slug: "lusidabortrialbalance"
updated: 2024-08-21T07:44:13Z
published: 2024-08-21T07:44:13Z
canonical: "support.lusid.com/lusidabortrialbalance"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.lusid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Lusid.Abor.TrialBalance

| **Type** | **Read/write** | **Author** | **Availability** |
| --- | --- | --- | --- |
| [Data provider](/v1/docs/what-are-a-data-provider-and-a-direct-provider) | Read | FINBOURNE | Provided with LUSID |

The `Lusid.Abor.TrialBalance` provider enables you to write a [Luminesce SQL query](/v1/docs/understanding-the-luminesce-sql-query-syntax) that generates [trial balances](/v1/docs/what-is-a-trial-balance) for one or more ABORs between two dates.

`Lusid.Abor.TrialBalance` returns one record per account with all the debits and credits aggregated for that account unless you specify a `GeneralLedgerProfileCode` to break down account activity by *levels* (or categories). [More about general ledger profiles](/v1/docs/using-a-general-ledger-profile-to-break-down-account-activity-in-a-trial-balance).

**See also:** [Lusid.Abor](/v1/docs/lusidabor)

## Basic usage

```sql
select * from Lusid.Abor.TrialBalance
where AborScope = <scope> 
and AborCode = <code>
and StartDate = #<date>#
and EndDate = #<date>#
;
```

## Query parameters

`Lusid.Abor.TrialBalance` has parameters that enable you to filter or refine a query.

To list available parameters, their data types, default values, and an explanation for each, run the following query using a [suitable tool](/v1/docs/what-tools-are-available-to-write-luminesce-queries):

```sql
select FieldName, DataType, ParamDefaultValue, Description from Sys.Field where TableName = 'Lusid.Abor.TrialBalance' and FieldType = 'Parameter';
```

## Data fields

By default, `Lusid.Abor.TrialBalance` returns a table of data populated with particular fields (columns). You can return a subset of these fields.

To list fields available to return, their data types, whether fields are considered 'main', and an explanation for each, run the following query using a [suitable tool](/v1/docs/what-tools-are-available-to-write-luminesce-queries):

```sql
select FieldName, DataType, IsMain, IsPrimaryKey, SampleValues, Description from Sys.Field where TableName = 'Lusid.Abor.TrialBalance' and FieldType = 'Column';
```

> **Note:** Fields marked 'main' are returned by queries that select a `^` character, for example `select ^ from Lusid.Abor.TrialBalance`.

## Examples

> **Note:** For more example Luminesce SQL queries, visit our [Github repo](https://github.com/finbourne/luminesce-examples/tree/master/examples/lusid/abor).

### Example 1: Generate a trial balance for a single ABOR and apply a general ledger profile

```sql
select * from Lusid.Abor.TrialBalance
where AborScope = 'Abor'
and AborCode = 'Standard'
and StartDate = #2023-08-01#
and EndDate = #2023-08-07#
and GeneralLedgerProfileCode = 'Currency';
```

### Example 2: Generate trial balances for multiple ABORs between the same dates

```sql
@abors = values
('Growth', 'UK-Equities'),
('Income', 'UK-Bonds')
;

select * from @abors a
inner join Lusid.Abor.TrialBalance t
  on t.AborScope = a.column1
  and t.AborCode = a.column2
where StartDate = #2023-08-01#
and EndDate = #2023-08-07#;
```
