Results 1 to 4 of 4
  1. #1
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    365

    Get Index

    I have some ID strings in a table as below and what to know the index for 'Next'.


    For example if 43094048 I want to return 3, 41911200 1 etc.


    I can think of some cludgy ways to do this but I suspect there's a clever 'Access" method and wonder what it might be?
    Thanks


    First Next
    42607288 41911200
    42607288 35415599
    42607288 43094048

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Sorry, don't understand. Need to better explain the rules for this algorithm. Why would you want to return 3 and 41911200?
    Last edited by June7; 12-23-2022 at 02:16 AM.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    365
    Sorry , typo should have been 43094048, It would be 3 as its the 3rd item (and 41911200 is the first).
    And the Order By field is "num"

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Ooops, I see that number now. But still not entirely clear what you want. If you want to calculate a row number for each group in FIRST field, that is not simple in Access query.

    Review http://allenbrowne.com/ranking.html

    and https://stackoverflow.com/questions/...nter-per-group

    and https://stackoverflow.com/questions/...umber-sequence
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Id is not an index in this table
    By DMT Dave in forum Access
    Replies: 2
    Last Post: 03-30-2020, 12:56 AM
  2. Index of ComboBox
    By Sibtain in forum Forms
    Replies: 1
    Last Post: 05-24-2013, 02:15 AM
  3. Where is the Index for Table?
    By netchie in forum Access
    Replies: 5
    Last Post: 12-13-2012, 07:53 PM
  4. Access won't set the first index to 1
    By togo in forum Access
    Replies: 5
    Last Post: 10-03-2012, 08:11 PM
  5. 'Id' is not an index in this table - Help
    By waldock9 in forum Access
    Replies: 3
    Last Post: 11-08-2011, 01:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums