To sum the results of a criteria collection you can use code such as the following, which gets the sum of all ticket activities for a ticket:
Sage.Platform.RepositoryHelper<Sage.Entity.Interfaces.ITicketActivity> repository = Sage.Platform.EntityFactory.GetRepositoryHelper<Sage.Entity.Interfaces.ITicketActivity>();
Sage.Platform.Repository.ICriteria criteria = repository.CreateCriteria();
criteria.Add(repository.EF.Eq("Ticket.Id", ticket.Id.ToString()));
criteria.SetProjection(repository.PF.Sum("ElapsedUnits"));
Double units = Convert.ToDouble(criteria.UniqueResult());