Tally SQL Queries - Ledger Table

Moderator: ramajayam

Post Reply
admin
Site Admin
Posts: 67
Joined: Wed Feb 07, 2024 8:24 am

Tally SQL Queries - Ledger Table

Post by admin »

Get the Name of the Ledger

Code: Select all

Select $Name from Ledger
Get the Name of the Ledger with the ClosingBalance

Code: Select all

Select $Name, $_ClosingBalance from Ledger

Get GST number from ledger Table

Code: Select all

Select $Name, $PARTYGSTIN from ledger

Code: Select all

Select $Name, $PARTYGSTIN from ledger where $Parent Like "%Sundry Debtors%"
Get list of Sundry Debtors

Code: Select all

Select $Name, $Parent, $PARTYGSTIN from ledger where $Parent Like "%Sundry Debtors%"
Get list of Sundry Creditors

Code: Select all

Select $Name, $Parent, $PARTYGSTIN from ledger where $Parent Like "%Sundry creditors"

Code: Select all

Select $Name, $Parent, $PARTYGSTIN from ledger where $Parent Like "%Sundry creditors%" or $Parent Like "%Sundry Debtors%" 
Registered Parties

Code: Select all

Select $Name, $Parent, $PARTYGSTIN from ledger where $Parent Like "%Sundry creditors%" or $Parent Like "%Sundry Debtors%"  and $PartyGSTIN is not null
Unregistered Parties

Code: Select all

Select $Name, $Parent, $PARTYGSTIN from ledger where $Parent Like "%Sundry creditors%" or $Parent Like "%Sundry Debtors%"  and $PartyGSTIN is null

Code: Select all

Select $Name, $Parent, $_PrimaryGroup, $ClosingBalance from ledger

Get the Debit Only Balance

Code: Select all

SELECT $Name, $ClosingBalance FROM Ledger WHERE $$IsDr:$ClosingBalance

Get the Credit Only Balance

Code: Select all

SELECT $Name, $ClosingBalance FROM Ledger WHERE NOT $$IsDr:$ClosingBalance

Code: Select all

Select $Name, $Parent, $_PrimaryGroup, $$AscrAmt:$ClosingBalance from ledger

Code: Select all

Select $Name, $Parent, $_PrimaryGroup, $$AscrAmt:$ClosingBalance as Closing_Balance from ledger
***String Start with the word Sundry Creditors

Code: Select all

Select $Name, $Parent, $PARTYGSTIN from ledger where $Parent Like "%Sundry creditors"
***String is contains the word Sundry Creditors

Code: Select all

Select $Name, $Parent, $PARTYGSTIN from ledger where $Parent Like "%Sundry creditors%"
***String end with the word Sundry Creditors

Code: Select all

Select $Name, $Parent, $PARTYGSTIN from ledger where $Parent Like "Sundry creditors%"
***String is contains the word S any where in the parent string

Code: Select all

Select $Name, $Parent, $PARTYGSTIN from ledger where $Parent Like "%S%"

Code: Select all

Select $Name, $Parent, $_PrimaryGroup, $OpeningBalance, $ClosingBalance, $Isrevenue from ledger 
Post Reply