Pages
Home
GP
AX
SQL Server
Downloads
Partners
Apr 8, 2011
SQL Script to Compare Bank Subledger balance to corresponding GL account balance
Posted by
Venugopal G A
@
11:15 AM
Script
---------------------------------------------------------------------------- -- Compare Bank Subledger balance to corresponding GL account balance in GP. -- Code by Venugopal G A -- mail me for any queries venuasg@gmail.com ---------------------------------------------------------------------------- DECLARE @CHECKBOOKID VARCHAR(30) SET @CHECKBOOKID = 'FIRST BANK' -- CHANGE THIS TO YOUR CHECKBOOK ID --Set Bank Type and get Bank Balance Select 'Bank' as SubType, CURRBLNC as SubBal, 0 as GLBal Into #SubtoGLCompare From CM00100 Where Chekbkid=@CHECKBOOKID /*Get the GL total for this Account. Change the account below or optionally add additional actnumbr parameters to tighten or broaden the account*/ INSERT #SubtoGLCompare (SubType,SubBal,GLBAL) SELECT 'Bank' as SubType, 0 as SubBal, SUM(Perdblnc) AS GLBal FROM GL11110 WHERE actnumbr_2 = '1100' -- Change this Select SubType, sum(Subbal) as SubBal, Sum(GLBal) as GLBAL, sum(SubBal)-Sum(GLBAL) as Difference, 'Difference is Subledger minus GL.' as Instructions from #SubtoGLCompare Group by SubType Drop Table #SubtoGLCompare
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment