Aggregate Functions: Differences Between X++ and SQL [AX 2012]
Updated: September 30, 2011
Applies To: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
In industry standard SQL, a database query can contain aggregate functions. Examples of such functions include count(RecID) or sum(columnA). When an aggregate function is used but no rows match the where clause, a row must be returned to hold the result of the aggregates. The one returned row shows the value 0 (zero) for the count function, and shows null for the sum function.
Microsoft Dynamics AX does not support the concept of null values for the database. Therefore, when the sum function would return null, no row is returned to the user. Also, each data type has a specific value that is treated like a null value in certain circumstances. For more information, see Null Values for Data Types.