Here is a query that we use all the time for randomizing. The (cat_ups_mailing_1) is the table you are selecting from and the (tmp_mail_4) is the table you make to put your random selection into. The fields selected in the where and order by are the criteria for your random selection.
SELECT TOP 100 CAT_UPS_MAILING_1.* INTO TMP_MAIL_4
FROM CAT_UPS_MAILING_1
WHERE (((CAT_UPS_MAILING_1.PHONE) Is Not Null) AND ((randomizer())=0))
ORDER BY Rnd(IsNull(CAT_UPS_MAILING_1.CONTROL_NBR)*0+1);
Then you make a module with this code.
Function Randomizer() As Integer
Static AlreadyDone As Integer
If AlreadyDone = False Then Randomize: AlreadyDone = True
Randomizer = 0
End Function
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.