select * from your table into cursor tmp for i=1 to 10 lnRecno = int(rand()*_tally) go lnRecno save the record somewhere endfor