PMBudgetTotalsByGroup.sql 557 B

123456789101112
  1. DROP VIEW IF EXISTS PMBudgetTotalsByGroup
  2. GO
  3. Create View PMBudgetTotalsByGroup
  4. as
  5. SELECT b.CompanyID, b.ProjectID, b.[Type], a.GroupID,a.GroupCD, sum(b.CuryAmount) as CuryAmount,
  6. sum(b.CuryRevisedAmount) as CuryRevisedAmount,
  7. sum(b.CuryCommittedAmount) as CuryCommittedAmount,
  8. sum(b.CuryCommittedInvoicedAmount) as CuryCommittedInvoicedAmount,
  9. sum(b.CuryActualAmount) as CuryAtualAmount
  10. from PMBudget b
  11. join PMAccountGroup a on b.CompanyID = a.CompanyID and b.AccountGroupID = a.GroupID
  12. group by b.CompanyID, b.ProjectID, b.[Type], a.GroupID,a.GroupCD