SQL Scripts for Microsoft Dynamics GP: Remaining Budget By Year Using PO Commitment Budget

Microsoft Dynamics GPThis 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 was created for a client who wanted to be able to see how much of the annual PO commitment budget was remaining. It takes into account postings to the GL, PO commitments and entered purchase requisitions. This particular client wasn;t interested in seeing having a period check, just a check against the overall annual budget amount.

/*
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). */
SELECT ACTINDX ,SUM(VALUE) AS VALUE ,YEAR1 FROM (SELECT GLB.ACTINDX AS ACTINDX ,SUM(GLB.BUDGETAMT) AS VALUE ,GLB.YEAR1 AS YEAR1 FROM GL00201 AS GLB --[gpt=GL00201] INNER JOIN CPO40002 AS CPOS --[gpt=CPO40002] ON CPOS.BUDGETID = GLB.BUDGETID WHERE PERIODID NOT IN (0,13) GROUP BY GLB.ACTINDX ,GLB.YEAR1 UNION ALL SELECT GLPB.ACTINDX AS ACTINDX ,SUM(ISNULL(GLPB.PERDBLNC,0)) * -1 AS VALUE ,GLPB.YEAR1 AS YEAR1 FROM GL10110 AS GLPB --[gpt=GL10110] WHERE GLPB.PERIODID NOT IN (0,13) GROUP BY GLPB.ACTINDX ,GLPB.YEAR1 UNION ALL SELECT CPO.ACTINDX AS ACTINDX ,SUM(ISNULL(CPO.Committed_Amount,0)) * -1 AS VALUE ,SYY.YEAR1 AS YEAR1 FROM CPO10110 AS CPO --[gpt=CPO10110] INNER JOIN SY40100 AS SYY --[gpt=SY40100] ON SYY.ODESCTN = 'Budget Transaction Entry' AND PERIODDT <= CPO.REQDATE AND PERDENDT >= CPO.REQDATE AND PERIODID NOT IN (0,13) GROUP BY CPO.ACTINDX ,SYY.YEAR1 UNION ALL SELECT POP.INVINDX AS ACTINDX ,SUM(ISNULL(POP.EXTDCOST,0)) * -1 AS VALUE ,SYY.YEAR1 AS YEAR1 FROM POP10210 AS POP --[gpt=POP10210] INNER JOIN SY40100 AS SYY --[gpt=SY40100] ON SYY.ODESCTN = 'Budget Transaction Entry' AND PERIODDT <= POP.REQDATE AND PERDENDT >= POP.REQDATE AND PERIODID NOT IN (0,13) GROUP BY POP.INVINDX ,SYY.YEAR1 ) AS REMBUDGT GROUP BY ACTINDX ,YEAR1

Excel Snippets: Formula to Calculate Monthly Value of a Mortgage with Monthly Interest

MicrosoftI might not post many Excel snippets, but I’m collecting them into a small Excel Snippets series to make them easy to find.

I’ve been using this formula for quite a while now, but have to admit that I did not create it and no longer remember from where I got it.

The basic use is that you would have the starting amount in cell C2 and then use this formula in the next cell down and replicate down the page and it will calculate interest on a monthly basis.

The first highlighted section is the % rate being charged on the mortgage and the second is the amount you’re paying each month.

=IF(C3<=0,0,ROUND((((1+({% rate}/100)/12)^(12/12))-1)*C3,2)+C3-({mortgage payment amount}))

I’ve used this formula for a while to calculate an estimate of my mortgage it calculates to within a reasonably close amount (usually within a handful of pounds) as my mortgage interest is calculated daily, not monthly, but I’ve not been able to work out/find a formula for daily interest.