Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
balance_sheet_sql_report [2019/01/30 16:00]
kcifreo [Explanation of SQL]
balance_sheet_sql_report [2019/02/20 10:38] (current)
kcifreo
Line 4: Line 4:
  
 Note: **The Retained Earnings balance is not pulled into this report**. The retained earnings amount calculation is shown in a separate SQL below, but is not included as a row in the report Note: **The Retained Earnings balance is not pulled into this report**. The retained earnings amount calculation is shown in a separate SQL below, but is not included as a row in the report
- 
- 
 ===== Sample Export ===== ===== Sample Export =====
  
Line 15: Line 13:
 |1||Undeposited Visa_MC||1024.00|| |1||Undeposited Visa_MC||1024.00||
 |1||Inventory Assets||NULL|| |1||Inventory Assets||NULL||
- 
-\\ 
- 
  
 ===== Risk of Data Corruption if Run Improperly ===== ===== Risk of Data Corruption if Run Improperly =====
Line 24: Line 19:
 ===== SQL ===== ===== SQL =====
  
-[[:​code_formatsql|code format"​sql"​]]+<​code>​ 
 +code format"​sql"​
  
 DECLARE @GLDate datetime; DECLARE @GLDate datetime;
Line 54: Line 50:
 ( (
  
-<​code>​ 
   SELECT   SELECT
-</​code>​ 
  
-<​code>​ 
     ROW_NUMBER() OVER(ORDER BY FormattedPath) as Row,     ROW_NUMBER() OVER(ORDER BY FormattedPath) as Row,
-</​code>​ 
  
-<​code>​ 
     GLTree.FormattedName,​     GLTree.FormattedName,​
-</​code>​ 
  
-<​code>​ 
     coalesce((select sum(Amount) from GL where GL.GLAccountID ​ GLTree.NodeID and EntryDateTime     coalesce((select sum(Amount) from GL where GL.GLAccountID ​ GLTree.NodeID and EntryDateTime
 </​code>​ </​code>​