Others

How to Group Educational Activities and Calculate Total Hours in Access

Muhammad TalhaMuhammad Talha Oct 28, 2026 868 views

Question details

The user needs to organize staff educational activities by category within an Access database and calculate the total accumulated hours for each staff member.

How to Group Educational Activities and Calculate Total Hours in Access
Product
Microsoft Access
Device & OS
not provided
Scenario
Tracking Continuous Professional Development (CPD) or educational session hours for employees using a relational database.
Observed behavior
Requires a structured table design and a grouped query method that correctly joins tables to output the total hours per staff member per category.
Before you start

Before writing the query, ensure your database tables are properly structured with correct primary and foreign key relationships to prevent duplicate data calculations.

Solution 1Recommended

Normalize Database Tables and Execute a Grouped Query

Divide your data into related tables and use an SQL GROUP BY statement to calculate the total hours accurately.

To effectively calculate totals without data duplication, your database should be normalized into distinct tables. Using an INNER JOIN in a grouped SQL query will allow you to combine the session records and calculate the sum of hours based on staff and category IDs.

1
Normalize the database tables

Create at least four separate tables to manage your data properly: Staff, CPD Categories, Educational Sessions, and Staff Sessions.

2
Set up the Staff Sessions junction table

In your Staff Sessions table, ensure you include 'StaffID', 'EdSessionID', and 'SessionDate' to track individual attendance for each session.

3
Write the grouped SQL query

Navigate to the Create tab, select Query Design, switch to SQL View, and enter the following query: SELECT StaffID, CPDCatID, Sum(CPDHours) AS TotalHours FROM tblStaffSessions INNER JOIN tblEdSession ON tblStaffSessions.EdSessionID = tblEdSession.EdSessionID GROUP BY StaffID, CPDCatID;

4
Join tables to display readable names

Switch back to Query Design View and add the Staff and CPD Category tables to the query space. Drag the relationship lines to link 'StaffID' and 'CPDCatID', then add the Name fields to the query grid so the final output displays actual names instead of just numerical IDs.

Normalize Database Tables and Execute a Grouped Query
Data Normalization Benefit: Using properly normalized tables ensures accurate mathematical calculations and prevents data anomalies when updating session hours in the future.
Free Microsoft Office alternative

Manage and Analyze Your Data Easily with WPS Office

While Microsoft Access handles complex relational databases, WPS Office offers a free, lightweight alternative for your everyday productivity and data tracking needs. If you want to group activities and calculate totals without writing SQL, WPS Spreadsheet provides an intuitive interface with seamless Microsoft Office compatibility.

  1. 1. Download and Install WPS Office: Get the free WPS Office suite from the official website and install it on your device.
  2. 2. Import Your Data: Open WPS Spreadsheet and open your exported Access data or CSV files containing the staff session logs.
  3. 3. Summarize with PivotTables: Go to the Insert tab, click PivotTable, and drag the Staff Name to rows and Session Hours to values to instantly summarize total educational hours.
Fully compatible with Microsoft Excel (.xlsx) formats for seamless data migration and sharing.Free and lightweight, running smoothly on Windows, Mac, and Linux with a familiar user interface.Easily calculate total hours and group categories using built-in PivotTables or SUMIFS functions without complex database setups.
microsoft office alternative - wps office

Frequently Asked Questions

What is database normalization in Microsoft Access?

Database normalization is the process of organizing data into multiple related tables (such as separating Staff details from Session details) to minimize redundancy and prevent data inconsistencies during updates.

Why use an INNER JOIN for calculating total hours?

An INNER JOIN connects records that have matching values in both tables. In this case, it ensures the query only calculates hours for educational sessions that a staff member actually attended by matching the Session IDs.

Can I use a PivotTable instead of an SQL query to calculate hours?

Yes. In Access, you can create a Crosstab Query to achieve a PivotTable-like result. Alternatively, you can export your raw data to a spreadsheet program like WPS Spreadsheet and use the PivotTable feature to group staff members and sum their hours visually.