Skip to content

The Soql.Function Enum

Jason Siders edited this page Jul 4, 2025 · 6 revisions

Enumerates the different Aggregate Functions that can be used in SOQL queries. Use this enum when constructing Soql.Aggregation objects.

Soql.Aggregation count = new Soql.Aggregation(Soql.Function.COUNT, User.Id);
Soql query = DatabaseLayer.Soql.newQuery(User.SObjectType)
  ?.addSelect(count)
  ?.toSoql();

Values

  • AVG,
  • CALENDAR_MONTH,
  • CALENDAR_QUARTER,
  • CALENDAR_YEAR,
  • COUNT,
  • COUNT_DISTINCT,
  • DAY_IN_MONTH,
  • DAY_IN_WEEK,
  • DAY_IN_YEAR,
  • DAY_ONLY,
  • FISCAL_MONTH,
  • FISCAL_QUARTER,
  • FISCAL_YEAR,
  • FORMAT,
  • HOUR_IN_DAY,
  • MIN,
  • MAX,
  • SUM,
  • WEEK_IN_MONTH,
  • WEEK_IN_YEAR

apex-database-layer

Home

Core Concepts

Reference Guide

Migration Gudes

Clone this wiki locally