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!

access 97: select rows between X and Y

Status
Not open for further replies.

withoutaclue

Programmer
Aug 28, 2002
31
0
0
GB
I have a very large table, where i want to be able to update srecords.

However as the table is so large i want to be able to it where i choose how many records changed.

here is to auto number on the table, and i dont want to change the format.

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

Select between ROW 100 and ROW 150

(there fore it should return 50 records)

ANy one got any ideas???
 
Hi!

If the autonumber is consequetive then you can put this in the criteria line for the autonumber field:

>99 and <151

If you want 50 records and it can be any 50 that match your criteria then tell Access to pick the Top 50.

hth
Jeff Bridgham
bridgham@purdue.edu
 
If the autonumber is consecutive then you could add this to the criteria of the autonumber filed in the query:Between [Enter start record] And [Enter end record]


Everytime you run this query it would prompt you for a start and end range based on the Autonumber field.
 
Here is generally what the query would look like.

SELECT TOP 5 dt.productid
FROM dbo_Products AS C INNER JOIN [SELECT top 9 productid FROM dbo_Products Order by productid] AS dt ON dt.productid=C.productid
ORDER BY C.productid;

In effect you get the upper limit and then work backward. If you want the last X many then reverse the sort (desc) else for first X many leave the sort ascending.

To make the TOP variable then dynamically build the query to insert what the top's should be.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top