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

  • SEARCH
  • Home
  • 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 a photography site that I want to prevent image copying from. How can
Have a query that should hopefully be nice and simple to answer. I have
I have a project in Access 97 that I have to add the ability
I have the following vba-code in an MS-Access97-frontend which opens a word-document stored on
Have a problem that seems easy on paper but i'm having a big problem
We have an Access database migrated from Access 97 to Acces 2007 with some
i am new in project for company that have bigger enterprise/accounting system based on
Have a MySQL database table with 2 columns: id, url The url column has
Have been trying for hours - unfortunately I'm stuck on this three-table join. The
Have a web service that implements REST (sort of) , Client request is made

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.