See the following article for the answer.
http://www.sqlservercentral.com/articles/comma+separated+list/71700/
If you want a coded answer, see the article at the first link in my signature line below.
--Jeff Moden
Change is inevitable... Change for the better is not.