Can someone help? I need sum of original approved budgets for all projects in a program
I can figure out how to get the sum of budgets... but the business wants the sum of the first approved budget for a project.
Here's what I'm using to get the current approved budget for one project
--original approved budget:
(select Sum(fpd.total_cost) from fin_plans fp, fin_cost_plan_details fpd where fpd.plan_id=fp.id and fp.plan_type_code='BUDGET' and fp.object_id=i.id
and fp.revision=(select min(fp1.revision) from fin_plans fp1, fin_cost_plan_details fpd1 where fpd1.plan_id=fp1.id and fp1.plan_type_code='BUDGET' and fp1.status_code='APPROVED' and fp1.object_id=i.id) ) originalbudget
I need to do that for a collection of projects...