On 2/18/2015 5:10 PM, jose i cabrera wrote: > So, in reality, all the tasks of the project of > like "lang" minus the PM, have to be added and 10% of that total be > calculated to the (on this instance) DE-DE PM task.
UPDATE LSOpenJobs SET ProjFund = ( SELECT round(sum(t2.ProjFund) * cast(LSOpenJobs.RateType as integer)/100.0 , 2) FROM LSOpenJobs t2 where LSOpenJobs.ProjID=t2.ProjID and LSOpenJobs.lang=t2.lang and t2.PSubClass != 'PM' ) WHERE PSubClass = 'PM'; This updates all PM projects at once, in the whole table. To be more selective, add conditions in the last WHERE clause to taste. -- Igor Tandetnik