I wrote the following query, and I got error - Invalid column name 'Incdate'.
select Count(*) as 'Amount', datepart(year, incidentdate) as 'Incdate' from MyTable group by Incdate
I changed it to Group by incidentdate, but the reult is not what I want.
What name should I use for the group by? I need to get the sum amount for individule year.