• I worked in SQL Server 2008 R2 and SQL Server 2012 and I ran this code and got the following error message:

    Column 'MyBalances.AccountBalanceDate' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.