Close!
what worked was:
'WHEN Codes.Criteria_ID is Null' as it is the codes file that doesn't
necessarily have to have a criteria attached...
Obviously I also had to add Codes.Criteria_ID to the 'Group By' clause as
well...
Cheers,
Carl
> Select Criteria.Criteria_ID, CriteriaDesc,
> Case
> When Criteria.Criteria_ID Is Null then 0
> Else (Count(Criteria_ID))
> End As CodeCount
> From Criteria
> Left Outer Join Codes
> ON Criteria.Criteria_ID = Codes.Criteria_ID
> GROUP BY Criteria.Criteria_ID, CriteriaDesc
> ORDER BY CriteriaDesc ASC