Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select Query in Access: selct reows between X & Y

Status
Not open for further replies.

withoutaclue

Programmer
Aug 28, 2002
31
0
0
GB
Sorry my last post had many spellings and there fore didnt phrase my quetion correctly

I have a very large table, where i want to be able to SLECT records.

However as the table is so large i want to be able to SELECT A PARTICULAR AMOUNT OF RECORDS

There is NO auto number on the table, and i dont want to change the format to create one.

Therefore the question is question How do i create a query where i can say,

Select rows between 100 and 150

(there fore it should return 50 records)

ANy one got any ideas???
 
"select rows between 100 and 150"

between 100 and 150 what? you have to have some column that you can base this sequence numbering on -- it could be a date, it could be a name field, it could be anything, but it has to be some column that you can order by

rudy
 
I have a book code, that is duplicated, but i want the user to know how many rows that he is attemted to select,

so he can say,
right i want to select rows 10-20 today, (then he will work on that)
and tomorow he will select 21-30 (and work on that then

I dont want to run a distinct either as that will effect my other queries that i intend to run on the data that i will collect

Basically its just a query that will try and minmise how records will be selected,
 
try this

Code:
select bookcode, otherstuff
  from yourtable X 
 where ( select count(*) 
           from yourtable  
          where bookcode < X.bookcode )
        between 21 and 30
 order by bookcode

you could make the 21 and 30 user variables
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top