Create table TestProbables (MyNumber I, TableI I) for i=1 to N && where N is the number of tables append from ("table"+transform(m.i)) replace TableID with m.i for empty(TableID) next select count(TableID) as Occurrences, MyNumber from TestProbables ; group by MyNumber having Occurrences >= MAXNUMBER into cursor PossibleCandidates ** There could be a case with the same number in one table, what do we want to do in such case?