CLOSE all use aliq excl *index on no tag no *set order to "no" for i = 1 to 20 && assume 20 values for flag * seek i &&Table has no index order set LOCATE FOR no=i && this is what i add copy next 5 to temp while no = i use aliq1 append from temp use aliq excl nextthanks,