Creating a Custom Aggregate Function for Access Queries Creating a Custom Aggregate Function for Access Queries database database

Creating a Custom Aggregate Function for Access Queries


Access has no support for custom aggregates. You can use custom domain aggregates, though.

Allen Browne has a sample custom domain aggregate. However, these will have a major impact on performance.

To identify the most frequent value, the recommended way is to use subqueries.

Solving this problem will require multiple steps, and solving all these is too broad for SO in my opinion.

The follow up step to select the top record per category is:

SELECT DatePST, Updated, Description FROM YourGroupByQuery q WHERE [Count] = (       SELECT Max(s.[Count])     FROM YourGroupByQuery s     WHERE s.[DatePST] = q.[DatePST] And s.[Updated] = q.[Updated])