Results 1 to 3 of 3
  1. #1
    mainmast is offline Novice
    Windows 11 Office 365
    Join Date
    May 2023
    Posts
    4

    Get a total with associative entity

    An employee can have more than one position and a position can belong to more than one employee.



    I have three tables:
    Employee
    EmployeePosition
    Position
    Click image for larger version. 

Name:	Screenshot 2023-06-07 135929.png 
Views:	15 
Size:	14.5 KB 
ID:	50326
    How do I get a query to show that total number of positions held by a employee?

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    You turn the query you have into a totals query by clicking on the sum (sigma) symbol on the Design ribbon then add the PositionID field form the EmployeePosition table,leave the two fields you currently have to have GroupBy in the Totals row and select Count for the PositionId. You should really review your table design; the EmployeePosition table should have an autonumber field EmployeePositionID set as the primary key, the PositionId field should be renamed PositionID_FK (and the one in the Position table PositionId_PK), ... you get the idea, easier to avoid confusion when building queries.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    mainmast is offline Novice
    Windows 11 Office 365
    Join Date
    May 2023
    Posts
    4
    Thanks Vlad,
    Got it working

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

Similar Threads

  1. Split Entity Table
    By Western_Neil in forum Database Design
    Replies: 3
    Last Post: 06-06-2018, 10:15 AM
  2. Entity Relationship
    By dfean in forum Access
    Replies: 2
    Last Post: 09-04-2016, 08:54 AM
  3. How to get Checkbox to populate an associative table
    By tbbrown32 in forum Programming
    Replies: 14
    Last Post: 01-06-2016, 11:16 AM
  4. Replies: 1
    Last Post: 05-18-2014, 10:44 AM
  5. Employees in same entity
    By cathal1292 in forum Access
    Replies: 3
    Last Post: 05-05-2014, 02:26 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