This script is part of the SQL Scripts for Microsoft Dynamics GP where I will be posted the scripts I wrote against Microsoft Dynamics GP over the 19 years before I stopped working with Dynamics GP.
This script returns a list of GL accounts along with the Posting Type and Account Category; I think it was created as a way to quickly give a user a file to check the configuration.
Created by Ian Grieve of azurecurve | Ramblings of an IT Professional (http://www.azurecurve.co.uk)
This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int).
GL5.ACTNUMST AS 'Account'
,GL1.ACTDESCR AS 'Description'
,CASE WHEN GL1.PSTNGTYP = 0 THEN 'Balance Sheet' ELSE 'Profit & Loss' END AS 'Posting Type'
,GL2.ACCATDSC AS 'Account Category'
GL00105 GL5 --Account Index Master (GL00105)
GL00100 GL1 --Breakdown Account Master (GL00100)
GL1.ACTINDX = GL5.ACTINDX
GL00102 GL2 --Account Category Master (GL00102)
GL2.ACCATNUM = GL1.ACCATNUM