Thursday, 15 December 2011

TRIAL BALANCE QUERY - 11i and R12

SELECT   gb.SET_OF_BOOKS_ID,
         glcc.CONCATENATED_SEGMENTS,
         glcc.SEGMENT3 Accountno,
         gb.PERIOD_NAME,
         NVL (gb.PERIOD_NET_DR, 0) - NVL (gb.PERIOD_NET_CR, 0) PTD,
         (NVL (gb.BEGIN_BALANCE_DR, 0) - NVL (gb.BEGIN_BALANCE_CR, 0))
         + (NVL (gb.PERIOD_NET_DR, 0) - NVL (gb.PERIOD_NET_CR, 0))
            YTD
  FROM   gl_balances gb, gl_code_combinations_kfv glcc
 WHERE       1 = 1
         AND gb.code_combination_id = glcc.code_combination_id
         AND gb.code_combination_id = 267552
         AND gb.period_name = 'JUL-11'
         AND gb.set_of_books_id = 5

No comments:

Post a Comment