The Below PLSQL Query is useful for Depreciation Forecasting
SELECT
pi.BOOK_TYPE_CODE,
ad.ASSET_NUMBER,
pi.period_name,
pi.fiscal_year,
cc.SEGMENT1 || '-' || cc.SEGMENT2 || '-' || cc.SEGMENT3 || '-' ||
cc.SEGMENT4 Expense_Account,
sum(pi.DEPRECIATION)
FROM fa_system_controls,
fa_proj_interim_rpt pi,
fa_additions ad,
gl_code_combinations cc
WHERE pi.code_combination_id = cc.code_combination_id
AND pi.asset_id = ad.asset_id
AND pi.request_id in (select max(request_id) from fa_proj_interim_rpt)
AND pi.BOOK_TYPE_CODE = &Book
GROUP BY pi.BOOK_TYPE_CODE,
ad.ASSET_NUMBER,
pi.fiscal_year,
pi.period_index,
pi.period_name,
cc.SEGMENT1,
cc.SEGMENT2,
cc.SEGMENT3,
cc.SEGMENT4
ORDER BY pi.fiscal_year,
pi.period_index,
pi.period_name
Thank you
ReplyDelete