Results 1 to 5 of 5
  1. #1
    rockell333 is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    33

    Create a new field that counts another field


    I want to create a field that counts how many times a specific id appears in a table. It will be helpful after I cleanse to see if things are wrong

  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,642
    Typically done with a totals query. For a specific ID

    SELECT ID, Count(*) AS HowMany
    FROM TableName
    WHERE ID = 123
    GROUP BY ID
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    since you self describe yourself as a novice; in query design mode - you have your table in the upper section, and bring down the field to be counted (or summed) into the lower section.... if there is to be a criteria such as ID 123 you need that field too in order to enter the criteria.

    then look for the sigma symbol in the ribbon - like a big E - and this is generically called an aggregate query; your 2 fields will default to 'Group' and they may be ok for the criteria field...but your counted field you want to change that to either count or sum as appropriate....

  4. #4
    rockell333 is offline Advanced Beginner
    Windows 8 Access 2010 64bit
    Join Date
    Sep 2015
    Posts
    33
    @pbaldy

    This will just be in a view correct? I am hoping for an actual field. Sorry for the delayed reply I went around it this time, but would love to know for next time

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    If you want a saved field you'll need to do it yourself. There's nothing built-in that will count other records. Most of us would counsel against trying to save that type of thing though.
    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: 5
    Last Post: 04-04-2014, 03:33 PM
  2. Replies: 13
    Last Post: 12-23-2013, 09:20 AM
  3. Replies: 10
    Last Post: 07-19-2013, 02:05 PM
  4. Replies: 5
    Last Post: 05-25-2012, 05:57 PM
  5. Replies: 3
    Last Post: 04-26-2010, 11:38 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