Extracting range of records (1 Viewer)

reptar

Registered User.
Local time
Today, 05:22
Joined
Jul 4, 2005
Messages
32
Was just wondering how i go about pulling out a range of records. I do not want to use my Primary Key autonumber value as some records have been deleted and selecting a range of 10 to 50 for example will not guarentee 40 records. Is there some way i can use an SQL command in the SQL View window to achieve this?


Cheers
 

Newman

Québécois
Local time
Today, 08:22
Joined
Aug 26, 2002
Messages
766
SELECT TOP ## * FROM [tblX];
## being the number of record needed.
 

reptar

Registered User.
Local time
Today, 05:22
Joined
Jul 4, 2005
Messages
32
Does this line of code take out the top x number of records? what if i wish to take out 30 records, starting from the 10th record?
 

Newman

Québécois
Local time
Today, 08:22
Joined
Aug 26, 2002
Messages
766
Yes it does.
You can always use multiple queries:
query1:top 40 from table
query2:top 10 from query1
query3:query1 - query2
There may be a better way, but as far as I can help you right now, this is what I suggest.
 

Users who are viewing this thread

Top Bottom