if (poslednaja_stroka) { while PrevRecotrds where ... { PrevRecords.Num = 0; PrevRecords.update(); } }