Reputation: 109
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
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
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