Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
control_sql_-_find_gl_out_of_balances [2019/02/05 11:17] admin |
control_sql_-_find_gl_out_of_balances [2019/02/05 11:18] (current) admin |
||
|---|---|---|---|
| Line 20: | Line 20: | ||
| <code sql> | <code sql> | ||
| -- GL Out of Balance Breakdown | -- GL Out of Balance Breakdown | ||
| + | |||
| + | |||
| DECLARE @StartDate DateTime | DECLARE @StartDate DateTime | ||
| DECLARE @EndDate DateTime | DECLARE @EndDate DateTime | ||
| SET @StartDate = ' | SET @StartDate = ' | ||
| SET @EndDate | SET @EndDate | ||
| + | |||
| SELECT | SELECT | ||
| (SELECT DivisionName AS Division | (SELECT DivisionName AS Division | ||
| Line 66: | Line 67: | ||
| DatePart(HOUR, | DatePart(HOUR, | ||
| OffBalanceSheet | OffBalanceSheet | ||
| - | HAVING | + | HAVING |
| ) AS OOBGL | ) AS OOBGL | ||
| + | |||
| LEFT OUTER JOIN TransHeader ON TransHeader.ID = OOBGL.TransHeaderID | LEFT OUTER JOIN TransHeader ON TransHeader.ID = OOBGL.TransHeaderID | ||
| - | |||
| LEFT OUTER JOIN Account ON TransHeader.AccountID = Account.ID | LEFT OUTER JOIN Account ON TransHeader.AccountID = Account.ID | ||
| + | ORDER BY Division, TheDate DESC, TheHour DESC, OrderNumber, | ||
| - | ORDER BY Division, TheDate DESC, TheHour DESC, OrderNumber, | ||
| </ | </ | ||