Thursday, July 20, 2017

Dynamics NAV - ALL GL Transactions for a period

SELECT     [CRONUS$G_L Entry].[Entry No_], [CRONUS$G_L Entry].[G_L Account No_], [CRONUS$G_L Account].Name,
                      [CRONUS$G_L Entry].[Posting Date], [CRONUS$G_L Entry].[Document Type], [CRONUS$G_L Entry].[Document No_],
                      [CRONUS$G_L Entry].Description, [CRONUS$G_L Entry].[Bal_ Account No_], [CRONUS$G_L Entry].Amount,
                      [CRONUS$G_L Entry].[Global Dimension 1 Code], [CRONUS$G_L Entry].[Global Dimension 2 Code], [CRONUS$G_L Entry].[User ID],
                      [CRONUS$G_L Entry].[Transaction No_], [CRONUS$G_L Entry].[Debit Amount], [CRONUS$G_L Entry].[Credit Amount],
                      [CRONUS$G_L Entry].[Document Date], YEAR([CRONUS$G_L Entry].[Posting Date]) AS PostYr, MONTH([CRONUS$G_L Entry].[Posting Date])
                      AS PostMth, [CRONUS$G_L Entry].[External Document No_], [CRONUS$G_L Entry].[Source Code]
FROM         [CRONUS$G_L Entry] LEFT OUTER JOIN
                      [CRONUS$G_L Account] ON [CRONUS$G_L Entry].[G_L Account No_] = [CRONUS$G_L Account].No_
WHERE     ([CRONUS$G_L Entry].[Posting Date] >= CONVERT(DATETIME, '2016-10-01 00:00:00', 102) AND
                      [CRONUS$G_L Entry].[Posting Date] <= CONVERT(DATETIME, '2017-06-30 00:00:00', 102))

No comments:

Post a Comment