select PackID,stuff((select '\r\n'+rtrim(IDNum) from IndicatorPackIDNum where PackID=a.PackID for xml path('') ),1,4,'') as IDNums from (select distinct PackID from IndicatorPackIDNum) a