>local lnRecNo >lnRecno = 1 >select NewTest >scan for ID1 = 2 > goto m.lnRecno in crsResult > replace ty2010 with crsResult.Total > lnRecno = lnRecno + 1 >endscan >>
>>>>SELECT ID1 ,Y2010, cast(0 as int) as Row FROM NEWTEST WHERE ID1=1 AND ID>0 into cursor crs1 readwrite >>>>replace all Row with recno() in crs1 >>>> >>>>SELECT ID1 ,Y2010, cast(0 as int) as Row FROM NEWTEST WHERE ID1=2 AND ID>0 into cursor crs2 readwrite >>>>replace all Row with recno() in crs2 >>>> >>>>select c2.ID1, c2.Y2010 + c1.Y2010 as Total from crs2 c2 ; >>>>inner join crs1 c1 on c2.Row = c1.Row into cursor crsResult nofilter >>>> >>>>update NewTest set ty2010 = c1.Total ; >>>>from NewTest inner join crsResult c1 on NewTest.ID1 = c1.ID1 >>>> >>>>at crsResult correct >>>> >>>>brow >>>>CLOSE all >>>>USE NewTest >>>>BROWSE && replace the first value for all mean where id1=2 >>>>>>>