You need to use one of the SQL Server string concatenation tricks, as described
here. I personally prefer FOR XML PATH
SELECT Tasks.TaskId, SUM(comments.timespent),
stuff( (SELECT ','+Comment
FROM comments p2
WHERE p2.entityid = comments.entityid
ORDER BY Comment
FOR XML PATH(''), TYPE).value('.', 'varchar(max)')
,1,1,'')
AS Comments
FROM comments
INNER JOIN tasks ON comments.entityid = tasks.taskid
WHERE ( comments.entity = 1 )
GROUP BY Tasks.TaskId