Results 1 to 2 of 2
  1. #1
    JangLang is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    7

    Query: Add 'Subset' counter to records

    In an Access 2010, I have a query grabbing records from an Invoice table. For each Invoice record, I want to begin a counter at '1' again. It would look like this (Invoice Num, Invoice counter num):

    987789,1
    987789,2
    987789,3
    456654,1
    456654,2


    123321,1
    947343,1

    Any ideas for building a statement in my query to make this happen?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Have you considered using a totals query? You can get a count using the count method within the totals row of the query's design view.

    It seems as though you are interested in storing a value that is dynamic (always changing) inside a table. Why not check in periodically and view what the count of a specific invoice record is within your "Activity" table is. Whatever that table may be or do.

    Otherwise, you will have to build out a separate log table and insert your invoice's ID number into that table. You will need another data field to hold the ever increasing count of unique Id numbers. The auto number Primary Key in this table will have to remain an independent column of fields.

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

Similar Threads

  1. Counter Query for Maintenance
    By theperson in forum Queries
    Replies: 3
    Last Post: 10-23-2012, 05:17 PM
  2. Replies: 6
    Last Post: 06-01-2012, 03:51 PM
  3. Print Subset of Records from From
    By ssthornton in forum Programming
    Replies: 6
    Last Post: 05-21-2012, 02:28 PM
  4. Replies: 5
    Last Post: 05-05-2012, 09:58 PM
  5. Incrementing Counter in Query
    By Rawb in forum Queries
    Replies: 9
    Last Post: 02-10-2011, 02:58 PM

Tags for this Thread

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