I need to show all categories, even if the client has no points for some of them. I'm not sure how to adjust my select staement to provide this.
SELECT tblLookupCateg.Category, IsNull(Sum(tblPoints.Points),0) AS TotalPoints, MONTH(tblpoints.[pDate]) pMonth
FROM stblpoints left outer JOIN
tblLookupCateg ON stblpoints.CategID = tblLookupCateg.CategID
WHERE (YEAR(tblpoints.[pDate]) = 2010) AND (MONTH(tblpoints.[Date]) = 8) AND (tblPoints.IndivID=14)
GROUP BY tblLookupCateg.Category,tblpoints.[pDate], MONTH(tblpoints.[pDate])
Category TotalPoints Month
PlanA 0 8
PlanB 3 8
PlanC 0 8
PlanD 5 8
SELECT tblLookupCateg.Category, IsNull(Sum(tblPoints.Points),0) AS TotalPoints, MONTH(tblpoints.[pDate]) pMonth
FROM stblpoints left outer JOIN
tblLookupCateg ON stblpoints.CategID = tblLookupCateg.CategID
WHERE (YEAR(tblpoints.[pDate]) = 2010) AND (MONTH(tblpoints.[Date]) = 8) AND (tblPoints.IndivID=14)
GROUP BY tblLookupCateg.Category,tblpoints.[pDate], MONTH(tblpoints.[pDate])
Category TotalPoints Month
PlanA 0 8
PlanB 3 8
PlanC 0 8
PlanD 5 8