SELECT DISTINCT GLE2.[G_L Account No_], GLE.[G_L Account No_] AS BalAccount, GLE.[Source Code]
FROM dbo.[CRONUS$G_L Entry] AS GLE INNER JOIN
(SELECT DISTINCT [G_L Account No_], [Document No_]
FROM dbo.[CRONUS$G_L Entry]) AS GLE2 ON GLE.[Document No_] = GLE2.[Document No_]
GROUP BY GLE2.[G_L Account No_], GLE.[G_L Account No_], GLE.[Source Code]
HAVING (GLE2.[G_L Account No_] IN (N'5420', N'5410')) AND (NOT (GLE.[Source Code] IN (N'REVERSAL', N'PAYMENTJNL', N'CASHRECJNL')))
No comments:
Post a Comment