SELECT gcc.concatenated_segments code_combination,
SUM (NVL (gb.begin_balance_dr, 0) - NVL (gb.begin_balance_cr, 0)
) beginning_bal,
SUM ( NVL (gb.begin_balance_dr, 0)
- NVL (gb.begin_balance_cr, 0)
+ (NVL (gb.period_net_dr, 0) - NVL (gb.period_net_cr, 0))
) end_bal
FROM gl_balances gb, gl_code_combinations_kfv gcc
WHERE gb.code_combination_id = gcc.code_combination_id
AND gcc.concatenated_segments = '101-000-01010-201001-000-0000-0000'
-- Enter GL Account
AND gb.ledger_id = 1 -- Enter the Ledger
AND gb.actual_flag = 'A'
AND gb.period_name = 'JAN-2015' --Enter the Period
AND gb.currency_code = (SELECT currency_code
FROM gl_ledgers
WHERE ledger_id = gb.ledger_id)
GROUP BY gcc.concatenated_segments
No comments:
Post a Comment