Differences
This shows you the differences between two versions of the page.
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 format" | ||
DECLARE @GLDate datetime; | DECLARE @GLDate datetime; | ||
Line 54: | 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 | ||
</ | </ |