HiI have the following Query....SELECT CASE WHEN (dbo.WeightLength.UserMidjeMatt) < (dbo.RangeValues.ValueRangeStart) THEN dbo.RangeValues.UnderValueChartDisplay WHEN (dbo.WeightLength.UserMidjeMatt) BETWEEN (dbo.RangeValues.ValueRangeStart) AND (dbo.RangeValues.ValueRangeEnd) THEN dbo.RangeValues.InbetweenValuesChartDisplay WHEN (dbo.WeightLength.UserMidjeMatt) > (dbo.RangeValues.ValueRangeEnd) THEN dbo.RangeValues.OverValueChartDisplay END AS 'Grade', dbo.Customers.Name, dbo.SurveyAnswerInfo.FackID, dbo.Users.GenderID, dbo.SurveyAnswerInfo.AvdIdFROM dbo.Gender INNER JOIN dbo.Users ON dbo.Gender.GenderID = dbo.Users.GenderID INNER JOIN dbo.SurveyAnswerInfo ON dbo.Users.UserID = dbo.SurveyAnswerInfo.UserID INNER JOIN dbo.WeightLength ON dbo.SurveyAnswerInfo.SurveyAnswerInfoID = dbo.WeightLength.SurveyAnswerInfoID INNER JOIN dbo.RangeValues ON dbo.WeightLength.MidjeMattHealthID = dbo.RangeValues.HealthID INNER JOIN dbo.Customers ON dbo.SurveyAnswerInfo.CompanyID = dbo.Customers.CustIDGROUP BY dbo.WeightLength.UserMidjeMatt, dbo.SurveyAnswerInfo.CompanyID, dbo.RangeValues.ValueRangeStart, dbo.RangeValues.ValueRangeEnd, dbo.SurveyAnswerInfo.DateAdded, dbo.Users.GenderID, dbo.SurveyAnswerInfo.FackID, dbo.SurveyAnswerInfo.UserAge, dbo.Customers.Name, dbo.RangeValues.UnderValueChartDisplay, dbo.RangeValues.InbetweenValuesChartDisplay, dbo.RangeValues.OverValueChartDisplay, dbo.SurveyAnswerInfo.AvdIdHAVING (dbo.SurveyAnswerInfo.DateAdded BETWEEN CONVERT(DATETIME, '2012-01-01', 102) AND CONVERT(DATETIME, '2013-09-02', 102)) AND (dbo.SurveyAnswerInfo.CompanyID = 149)
this Query give me a result like this....Grade NameNormal HC Normal HC Normal HC Normal HC NA HC NA HC DA HC
I would like to sum the different grades so it look like this instead...Grade Name QtyNormal HC 4NA HC 2DA HC 1
What do I need to change to get it like that?