user1894555
user1894555

Reputation: 109

Access 'select rows between' query

I have a basic query in access. The SQLlooks like:

SELECT tblAssignedWords.ChildID, tblAssignedWords.Child, tblAssignedWords.WordID, tblAssignedWords.Word, tblAssignedWords.Status, tblAssignedWords.WordDifficulty, tblAssignedWords.WeekNumber
FROM tblAssignedWords
WHERE (((tblAssignedWords.ChildID)=1));

This pulls through 70 records. I only want to see records on rows between 10 and 20 (10 records in total). Is there and SQL statement i can use to see only these rows?

Thanks

Craig

Upvotes: 0

Views: 777

Answers (2)

Gordon Linoff
Gordon Linoff

Reputation: 1269873

Sort of. You need to have some measure of the ordering. Let me assume this is WordId:

SELECT top 10 *
from (SELECT top 20 aw.ChildID, aw.Child, aw.WordID, aw.Word, aw.Status,
             aw.WordDifficulty, aw.WeekNumber
      FROM tblAssignedWords aw
      WHERE aw.ChildID = 1
      ORDER BY WordId
     ) t
ORDER BY WordId Desc;

Upvotes: 2

user2763765
user2763765

Reputation:

SELECT tblAssignedWords.ChildID, tblAssignedWords.Child, tblAssignedWords.WordID, tblAssignedWords.Word, tblAssignedWords.Status, tblAssignedWords.WordDifficulty, tblAssignedWords.WeekNumber
FROM tblAssignedWords
WHERE tblAssignedWords.ChildID between 10 and 20

use this

Upvotes: 0

Related Questions