-- fix effort total in DT823 for existing program status reports
update DT823
set (DI008610, DI008615) = 
(select nvl(sum(DI060605),0), nvl(sum(DI060334),0)
 from DT284
    where DI060297 = DT823.DI008413
    and DI060300 = DT823.DI008416)
where DI008413 in (select DI001001 from DT461
                   where DI023220 = 30);