MOD Function Question

  • Thread starter Thread starter Michelle B.
  • Start date Start date
M

Michelle B.

Hi,

Can anyone tell me how to use the MOD function to Nth a
quantity into thirds? I need to pull every third record
for a mailing. I've used it before to pull all the odd
records for a mailing but it's been so long I forgot how
to use it. Or if there is a better way than using the MOD
function, please let me know.

Thank you,

Michelle Bardin
 
Assuming you've got a field (say, named "Your Field") with non-negative,
whole number values that are uniformly distributed, you might use a query
whose SQL looks something like this:

SELECT
[Your Table].*
FROM
[Your Table]
WHERE
[Your Table].[Your Field] Mod 3 = 0

If your field doesn't satisfy these assumptions (but "Your Field" has at
least non-Null number values), and you don't mind if the records are
randomly selected or if you get slightly more or less than 1/3 of the
records, you might try a query whose SQL looks something like this:

SELECT
[Your Table].*
FROM
[Your Table]
WHERE
Rnd([Your Table].[Your Field])<1/3
 
Back
Top