Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
balance_sheet_sql_report [2019/01/30 16:00] kcifreo [Sample Export] |
balance_sheet_sql_report [2019/02/20 10:38] kcifreo |
||
---|---|---|---|
Line 3: | Line 3: | ||
This SQL (Report) can be used to pull the Balance Sheet for any period in an easy-to-export format. | This SQL (Report) can be used to pull the Balance Sheet for any period in an easy-to-export format. | ||
- | < | + | 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 13: | 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 22: | Line 19: | ||
===== SQL ===== | ===== SQL ===== | ||
- | [[: | + | < |
+ | code format" | ||
DECLARE @GLDate datetime; | DECLARE @GLDate datetime; | ||
Line 52: | Line 50: | ||
( | ( | ||
- | < | ||
SELECT | SELECT | ||
- | </ | ||
- | < | ||
ROW_NUMBER() OVER(ORDER BY FormattedPath) as Row, | ROW_NUMBER() OVER(ORDER BY FormattedPath) as Row, | ||
- | </ | ||
- | < | ||
GLTree.FormattedName, | GLTree.FormattedName, | ||
- | </ | ||
- | < | ||
coalesce((select sum(Amount) from GL where GL.GLAccountID | coalesce((select sum(Amount) from GL where GL.GLAccountID | ||
</ | </ |