Skip to content
  • Home
  • About Me
    • Disclaimer
    • Privacy Policy
    • Terms of Use
    • Consultant’s Toolbox
  • Solutions
    • Dynamics 365
      • D365 Business Central
      • D365 Finance & Operations
    • Dynamics GP
      • GP 2018 Toolbox
    • Dexterity
    • Royalty Management System
    • Franchisee Portal
  • Contact Me

Dynamics Insight – Modern ERP Perspectives

Driving Innovation with Microsoft Dynamics 365, Power Platform & Data-Driven Strategy
Menu
Facebook Twitter Google+ LinkedIn
  • Home
  • About Me
    • Disclaimer
    • Privacy Policy
    • Terms of Use
    • Consultant’s Toolbox
  • Solutions
    • Dynamics 365
      • D365 Business Central
      • D365 Finance & Operations
    • Dynamics GP
      • GP 2018 Toolbox
    • Dexterity
    • Royalty Management System
    • Franchisee Portal
  • Contact Me
Home  /  Dynamics GP  /  SQL Script to List Actual vs Budget for GL Accounts by Period
PostedinDynamics GP Posted on April 10, 2013

SQL Script to List Actual vs Budget for GL Accounts by Period

Posted By Samuel Mathew

A few months back one of my customers asked me to create a script that shows net actual amount and total budget amount for a particular account and for a specific year. After working on the script, I thought about expanding the script and create a view to listing all General Ledger accounts with actual amount, budgeted amount and the variance by year and period.

The view below links GL20000 (GL_YTD_TRX_OPEN – Year-to-Date Transaction Open) and GL00201 (GL_Budget_SUM_MSTR – Budget Summary Master) and GL00105 (GL_Account_Index_MSTR – Account Index Master). The variance is a calculated field (actual – budget).

CREATE VIEW view_GL_Actual_vs_Budget_by_Period
AS
    -------------------------------------------------------------------------
    -- Created by    :    Samuel Mathew, Eclipse Computing, Inc.
    -- Date            :    04/08/2013
    -- Description    :    Displays Actual, budget and variance for all accounts
    --                    by year and period.
    -------------------------------------------------------------------------
    SELECT GL00105.ACTNUMST AS 'ACCOUNT',
           GL00201.YEAR1 AS 'YEAR',
           GL00201.PERIODID AS 'PERIOD',
           ISNULL(tSQL.ACTUAL, 0) AS 'ACTUAL',
           GL00201.BUDGETAMT AS 'BUDGET',
           (ISNULL(tSQL.ACTUAL, 0) - GL00201.BUDGETAMT) AS VARIANCE
    FROM   GL00201
           INNER JOIN
           GL00105
           ON GL00201.ACTINDX = GL00105.ACTINDX
           LEFT OUTER JOIN
           (SELECT   GL00105.ACTINDX,
                     GL20000.OPENYEAR,
                     GL20000.PERIODID AS 'PERIOD',
                     SUM(GL20000.DEBITAMT) - SUM(GL20000.CRDTAMNT) AS 'ACTUAL'
            FROM     GL20000
                     INNER JOIN
                     GL00105
                     ON GL20000.ACTINDX = GL00105.ACTINDX
            WHERE    (GL20000.SOURCDOC <> 'BBF')
            GROUP BY GL00105.ACTINDX, GL20000.OPENYEAR, GL20000.PERIODID) AS tSQL
           ON tSQL.PERIOD = GL00201.PERIODID
              AND tSQL.OPENYEAR = GL00201.YEAR1
              AND tSQL.ACTINDX = GL00201.ACTINDX;
 
 
GO
GRANT select
    ON view_GL_Actual_vs_Budget_by_Period TO DYNGRP;

 

 

 

Tags: Script SQL Server
Share on Facebook Share on Twitter Share on Google+ Share on LinkedIn Share on Pinterest
Previous Article
Eclipse Royalty & Rights Management System for Dynamics GP 2013 Now Available
Next Article
Microsoft Dynamics GP 2013 Reporting – Second Edition

About Author

Samuel Mathew

Software developer acknowledged for talents conceptualizing and directing the development and continuous refinement of advanced technology solutions to meet clients’ needs. Sophisticated programming knowledge combines with well-honed problem-solving strengths to meet the challenges of business economics, client needs, and technical innovation.

Facebook Twitter LinkedIn

Related Posts

  • Why Technology Leaders Should Attend Community Summit North America 2026

    August 5, 2026
  • Understand Dynamics GP Lifecycle Policies

    December 2, 2024
  • Error : “The selected company is not configured as a company of the current Microsoft Dynamics GP system database. You must resolve the database configuration to log in to the company”

    April 10, 2018

Social Media

  • LinkedIn
  • Google
  • Facebook
  • Twitter
  • Pinterest

About Me!

Samuel Mathew

Software developer acknowledged for talents conceptualizing and directing the development and continuous refinement of advanced technology solutions to meet clients’ needs. Sophisticated programming knowledge combines with well-honed problem-solving strengths to meet the challenges of business economics, client needs, and technical innovation.

Subscribe

Archives

  • October 2026
  • August 2026
  • July 2026
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • January 2023
  • April 2018
  • March 2018
  • February 2018
  • December 2017
  • November 2017
  • April 2017
  • January 2017
  • September 2016
  • June 2016
  • May 2016
  • April 2016
  • October 2015
  • February 2015
  • November 2014
  • February 2014
  • April 2013
  • March 2013

Categories

  • D365 Business Central
  • D365 Finance & Operations
  • Dexterity
  • Dynamics 365
  • Dynamics GP
  • Dynamics Summit NA
  • Fabric IQ
  • Featured
  • Franchisee Portal
  • General
  • GP 2018 Toolbox
  • Microsoft Fabric
  • Power BI
  • Royalty Management System

Tags

AI Agents Azure Data Lake Business Central Community Summit D365F&O Security Development Dexterity Dynamics 365 Dynamics 365 F&O Dynamics Communites Dynamics GP Environment ERP Strategy ERP System Featured GP GP 2013 GP 2016 GP 2018 GP Web Client Installation Microsoft Copilot Microsoft Dynamics Microsoft Dynamics 365 BC Microsoft Fabric Microsoft SQL Server Migration from GP to Business Central Multi-tenant Power Platform Product LifeCycle Royalty & Rights Script SmartList SmartList Designer SQL Reporting Services SQL Script SQL Server Summit NA Synapse Analytics Technology Leadership Telemetry

inD365 Business Central March 14, 2018

Announcing Microsoft Dynamics 365 Business Central

BySamuel Mathew
inDynamics GP February 10, 2015

Who actually uses the Dynamics GP Multi-Tenant feature?

BySamuel Mathew

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

AI Agents Azure Data Lake Business Central Community Summit D365F&O Security Development Dexterity Dynamics 365 Dynamics 365 F&O Dynamics Communites Dynamics GP Environment ERP Strategy ERP System Featured GP GP 2013 GP 2016 GP 2018 GP Web Client Installation Microsoft Copilot Microsoft Dynamics Microsoft Dynamics 365 BC Microsoft Fabric Microsoft SQL Server Migration from GP to Business Central Multi-tenant Power Platform Product LifeCycle Royalty & Rights Script SmartList SmartList Designer SQL Reporting Services SQL Script SQL Server Summit NA Synapse Analytics Technology Leadership Telemetry

© Copyright 2020 Samuel Mathew.  All rights reserved.