Every tenth record

B

blendes

I am working on a databse that collects records for parts that are being
tested. I got a new requirement that they want the testers to record a value
every tenth record. I am wondering if anyone could help me try to figure this
out. I have tried but keep having to start over because it does not work.
 
A

Allen Browne

If your data is sorted by a primary key named ID, you could get every 10th
record with a subquery like this:

SELECT Table1.*
FROM Table1
WHERE (SELECT Count("*") AS HowMany
FROM Table1 AS Dupe
WHERE Dupe.ID <= Table1.ID) Mod 10 = 0;

If subqueries are new, here's an introduction:
http://allenbrowne.com/subquery-01.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top