Aggregate Query Changes (LP #14007247 / #14007514)

Adds the new aggregate query support needed for the user reports.