Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 564635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:47:15+00:00 2026-05-13T12:47:15+00:00

I have an Access97 database (unfortunately) and I am querying it over ODBC. I

  • 0

I have an Access97 database (unfortunately) and I am querying it over ODBC.

I want to construct a query that will return me J ordered rows starting at offset K. Right now for a related operation I am using a sub-query and the TOP keyword, this works fine but I don’t think I can use it for this new operation I am trying to perform. I am wanting to do this because I want to add some form of paging to some software.

Ideally the user interface should be able to say, give me 50 records, starting at record 150, sorted by the date column.

Any help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T12:47:15+00:00Added an answer on May 13, 2026 at 12:47 pm

    You’re basically trying to mimic ROW_NUMBER() in Access. Unfortunately, Access is not a good engine for doing this kind of thing. It gets dog slow after a hundred or so records.

    With that said, here’s what you can do:

    SELECT t1.ID, t1.SomeText, t1.SomeDate,
    (
      SELECT COUNT(*) + 1
      FROM Table1 AS t2
      WHERE t1.SomeText > t2.SomeText
    ) as RowNumber
    FROM Table1 t1
    ORDER BY t1.SomeText
    

    That will produce this resultset (in my particular table):

    ID | SomeText             | SomeDate  | RowNumber
    10 | 4NGJN                | 1/20/2010 | 1
    11 | ABH                  | 1/20/2010 | 2
    2  | asldkfj              | 1/20/2010 | 3
    1  | asldkfjaslgh         | 1/20/2010 | 4
    7  | ewoiuhdkjnlbkjbn     | 1/20/2010 | 5
    4  | oihkjldhnlkmdfn,mn   | 1/20/2010 | 6
    3  | oihoih               | 1/20/2010 | 7
    5  | qwwern               | 1/20/2010 | 8
    8  | SKN                  | 1/20/2010 | 9
    9  | WEOIN                | 1/20/2010 | 10
    6  | wetrhn               | 1/20/2010 | 11
    12 | XDNKJ                | 1/20/2010 | 12
    

    I would make a saved query in Access (a view in a SQL Server) and then write a query like this in your application:

    SELECT ID, SomeText, SomeDate, RowNumber
    FROM myView
    WHERE RowNumber > 5
      AND RowNumber < 11
    

    Of course, “5” & “11” you would pass in from your client app, and would be based on the particular page you’re on. (It would probably be 50 and 100 or something for you).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have data that has this kind of structure. Will be in ascending order by
Have some dates in my local Oracle 11g database that are in this format:
Have a query that should hopefully be nice and simple to answer. I have
I have a folder full of 100-odd Access97 files. I need to update them
Suppose: I have a single table that holds the book ID, student ID and
I have a project in Access 97 that I have to add the ability
Have searched the database but need to specifically sum(of hours flown or days off)in
Have finally got a responsive site working (of a fashion). What I want to
Have a look at one of my websites: moskah.com The problem is that it
Have a simple contact us XPage created. Have server side validation in place that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.