Results 1 to 4 of 4
  1. #1
    JustinC is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    8

    count Duplicate

    Hi all,

    I have a sample table with duplicate.

    ID. Name Items
    123456 James Book
    123456 James Pencil
    876543 Elan Ruler
    123456 James Pen
    876543 Elan Paper
    765432 Gerald Card

    How do I add a column to count duplicate sequentially?

    Output:

    ID. Name Items Count
    123456 James Book 0
    123456 James Pencil 1
    123456 James Pen 2
    876543 Elan Ruler 0
    876543 Elan Paper 1
    765432 Gerald Card 0

    Thank you!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    It would be simple on a report, using the running sum property of a textbox (after grouping on the person). In a query you'd need to use DCount() or a subquery, either of which could really slow things down.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    JustinC is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2014
    Posts
    8
    Hi Phaldy,
    Can you show me an example of DCount() or subquery to accomplish this?

    Thanks!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Along the lines of:

    DCount("*", "TableName", "ID = " & ID & " AND Items < '" & Items & "'")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 3
    Last Post: 03-01-2013, 12:41 PM
  2. COUNT Group Count Records COUNT FUNCTION
    By PMCOFFEY in forum Access
    Replies: 9
    Last Post: 11-09-2012, 09:40 PM
  3. Query to count errors when records duplicate
    By mkallover in forum Queries
    Replies: 1
    Last Post: 07-15-2011, 11:40 PM
  4. Replies: 0
    Last Post: 07-13-2011, 08:32 AM
  5. Replies: 1
    Last Post: 08-18-2010, 02:36 AM

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