Use theTable AFields(laStru) Create Cursor cuOutput From Array laStru ** to get possible values Select Distinct zip, biztype ; from theTable ; into cursor cuZipBiztype Scan lcZip=cuzipbiztype.zip lcBiztype=cuzipbiztype.biztype ** get 2 random records Select top 2 zip, biztype, other1, other2, Rand()*10 as Ordering ; from theTable ; where zip=lcZip and biztype=lcBizType ; order by Ordering ; into cursor cuRandom Select cuOutput Append From DBF("cuRandom") EndScan>Hi All,