>>select sum(Payments) as TotalPayments from myTable where IDField = 2134 into cursor c_TotalPayments >> >>? nvl(c_TotalPayments.TotalPayments,0)>
>local SumPayment, IdToDo >SumPayment = 0 >IdToDo = 2134 > >&& set order to the index on IdField >&& best set talk Off > >if( seek(m.IdToDo, 'AliasName') ) > sum Payment rest while (IdField == m.IdToDo) to SumPayment >endif > >I can't think of any way where it would be slower.