I think you need any one of the belowSELECT Test_Profile,AVG(Test_Price * 1.0) AS AvgVal1,SUM(Test_Price)*1.0/NULLIF(COUNT(DISTINCT Discrete_Test),0) AS AvgVal2,SUM(Test_Price)*1.0/NULLIF(COUNT(Discrete_Test),0) AS AvgVal3FROM TableGROUP BY Test_Profile
------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs