Results 1 to 5 of 5
  1. #1
    Brandon12 is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Sep 2017
    Posts
    5

    Counting Common Attributes


    Hello - I am somewhat new to Access, but I have used it to do some pretty cool stuff already. However, a current project has me stumped. I am attempting to count the number of times two separate attributes share a common, separate attribute. Below is an example of the data. How can I count the number of times A & B, A & C, and B & C share the attribute shown in the first column. Thank you!

    Attribute Item
    1 A
    1 B
    1 C
    2 A
    3 A
    3 B
    4 A
    4 B
    5 B
    6 A
    6 B
    7 B
    7 C
    8 A
    8 C
    9 C
    10 A
    10 B
    10 C

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Can you post the how the results would look? That would help us understand better what you are trying to achieve.

  3. #3
    Brandon12 is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Sep 2017
    Posts
    5
    Quote Originally Posted by aytee111 View Post
    Can you post the how the results would look? That would help us understand better what you are trying to achieve.
    Item Item In Common
    A B 5
    A C 3
    B A 5
    B C 3
    C A 3
    C B 3

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Table2 is your table name - it is referenced twice. Change it to your table name.

    SELECT Table2.Item, Table2_1.Item, Count(Table2.Attribute) AS InCommon
    FROM Table2 INNER JOIN Table2 AS Table2_1 ON Table2.[Attribute] = Table2_1.[Attribute]
    GROUP BY Table2.Item, Table2_1.Item
    HAVING (((Table2_1.Item)<>[table2].[Item]));

  5. #5
    Brandon12 is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Sep 2017
    Posts
    5
    Thank you very much! Worked like a charm!

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

Similar Threads

  1. Query need more attributes from other tables
    By oemar00 in forum Queries
    Replies: 3
    Last Post: 10-15-2013, 07:35 AM
  2. Derived attributes
    By mlbwhf in forum Access
    Replies: 8
    Last Post: 11-06-2012, 09:07 PM
  3. Assigning grouped attributes to a record
    By owenik in forum Access
    Replies: 3
    Last Post: 10-02-2011, 05:10 PM
  4. attributes out of order
    By Dornenhexe in forum Queries
    Replies: 9
    Last Post: 07-12-2010, 02:36 PM
  5. Hidden Attributes
    By NMJones in forum Access
    Replies: 1
    Last Post: 02-09-2010, 10:57 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