Invalid arguments used with domain function. (Error 2428)

You have entered an invalid argument in an aggregate function. For information on the function's arguments, see SQL Aggregate Functions, and then choose the name of the function.