Skip to main content

Notifications

Microsoft Dynamics GP (Archived)

GL Trail balance report

Posted on by 1,771

Hi,

I want to create GL trail balance report.  I would like to know what are the tables need to use to retrieve below mentioned data from SQL SSRS

Account

Description

Beginning Balance

Debit

Credit

Net Change

Ending Balance

10-0100-0110-01101

EQUIP - COMPUTERS COST

2,650,391.74

10,452.69

0

         10,452.69

     2,660,844.43

10-0100-0110-01102

EQUIP - SOFTWARE COST

1,733,668.86

0

0

                   -  

     1,733,668.86

10-0100-0110-01103

EQUIP - TELEPHONES COST

61,403.93

0

0

                  -  

         61,403.93

*This post is locked for comments

  • Suggested answer
    Victoria Yudin Profile Picture
    Victoria Yudin 22,766 on at
    RE: GL Trail balance report

    I have a number of blog posts with code for different versions of the General Ledger Trial Balance: victoriayudin.com/.../general-ledger-sql-views

    Hope this helps with what you're looking to do.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: GL Trail balance report

    You can use this query and alter it to fit your needs:

    /*

    Trial Balance Query

    */

    declare @Year int

    declare @cmp varchar(4)

    set @Year = 2018;

    With TB (CompanyID,CompanyDescription,Account,[Description],BeginBal,Debit,Credit,NetChange,Ending) as

    (

    select A.Segment1 [CompanyID],

    C.dscriptn [CompanyDescription],

    [account number] ACCOUNT,

    B.DSCRIPTN [Description],

    SUM(CASE When [Period ID] = 0 THEN [Period Balance] ELSE 0 END) AS BEGINBAL,

    SUM(CASE When [Period ID] > 0 THEN [Debit Amount] ELSE 0 END) AS Debit,

    SUM(CASE When [Period ID] > 0 THEN [Credit Amount] ELSE 0 END) AS Credit,

    SUM(CASE When [Period ID] > 0 THEN [Period Balance] ELSE 0 END) AS NetChange,

    SUM([Period Balance]) AS ENDING

    FROM (AccountSummary A

    left join gl40200 B

    on A.Segment2 = b.SGMNTID)

    left join gl40200 C on

    A.segment1 = c.sgmntid

    WHERE [Account Type]='posting account'

    and [Year] = @Year

    and b.sgmtnumb = 2

    and c.sgmtnumb = 1

    GROUP BY [segment1]

               ,[Account Number]

    ,b.dscriptn

    ,C.dscriptn

    )

    Select [CompanyID]

    ,[CompanyDescription]

    ,Account

    ,[Description] = case [Description]

    when '' then (select top 1 actdescr from gl00100 where MNACSGMT = Account)

    else [Description]

    end

    ,BeginBal

    ,Debit

    ,Credit

    ,NetChange

    ,Ending

    from TB

    order by CompanyID,account;

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans