Results 1 to 3 of 3
  1. #1
    Sandi is offline Novice
    Windows 98/ME Access 2003
    Join Date
    May 2011
    Posts
    7

    Finding missing numbers in a sequence field

    Hello,

    I have a table "tbl_talent_database" and one of the relevent fields (also primary key) is "TalentID". From all the TalentIDs, I would like to find the ID's that have not been used.

    So say for example, My TalentID field might contain:

    2
    3
    4
    5
    6
    8



    I want to build or create a query to identify 1 and 7 TalentID's have not been used.

    I would like to create a query in design view so I would really appreciate if someone can help me out from there.


    Thanks,

    Sandi

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    is the fld an autonumber? if it is, missing numbers like that indicate deleted records, not unused numbers. If it's not, before you write a query like that, you need to determine HOW a number could be missing.

    for instance, if you have a form to enter new records and one fld is autmatically set up to fill the pk field in using:
    Code:
    =dmax("field", "table") + 1
    then the missing records would also indicate deletion. the important thing to do here first is to figure out IF your missing numbers really do reflect what you're looking for.

  3. #3
    Sandi is offline Novice
    Windows 98/ME Access 2003
    Join Date
    May 2011
    Posts
    7
    I hope I make sense, there is very good reason I need to find the missing ID numbers is so I use every single number from 1.....to as many..The talent ID is the primary key for a profile of one person, once they move on to another level, i need to change the ID number to an ID number according to the website, so I want to be able to use the old ID at another point for someone els's profile.

    And no the Talent ID field is not autonumber..just number field.

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

Similar Threads

  1. Replies: 4
    Last Post: 10-15-2010, 07:50 AM
  2. Reverse Sequence of Numbers
    By OpsO in forum Queries
    Replies: 1
    Last Post: 08-12-2010, 06:05 PM
  3. Replies: 1
    Last Post: 03-05-2010, 12:27 PM
  4. Find Missing Number in Sequence per Record
    By escuro19 in forum Programming
    Replies: 1
    Last Post: 11-10-2009, 03:15 PM
  5. Finding highest value in a text field
    By cdominguez in forum Queries
    Replies: 3
    Last Post: 06-02-2009, 09:39 AM

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