Re: Grouping with Datareport
hi,
have you tried using the sql group by?
greg:)
Re: Grouping with Datareport
Yup, but it keeps telling me that I need to do something with my other 2 rows, because if not SQL cannot group them, if for example I have only 1 row that I want to group, i'd just do this:
Code:
SELECT CompanyId FROM Employees GROUP BY CompanyId
The problem is when I try to do it with 2 or more rows, example:
Code:
SELECT CompanyId, Name, Salary FROM Employees GROUP BY CompanyId
With that query, SQL complains about what should it do with the next column "Name". Error says:
Code:
Msg 8120, Level 16, State 1, Line 1
Column 'Employees.Name' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Please can somebody help me please? :cry: