You Not Grouping Properly SELECT P.ProjectID, P.userID, P.startDate, P.enddate, C.quarter,P.Cost, P.percent, COUNT(C.date) AS totalDays, ((percent/100)*COUNT(C.date)*Cost*8) AS totalcost FROM Project AS P INNER JOIN Calendar AS C ON Calendar.date >P.startDate AND Calendar.date <= P.enddate WHERE (C.isWeekday =1) AND (C.isHoliday=0) GROUP BY P.ProjectID, P.userID, P.startDate, P.enddate, C.quarter,P.Cost, P.percent ORDER BY P.ProjectID You Have No Need To It totalDays,totalCost in Group By