SELECT TM_User.TM_UserID, TM_User.FullName,TM_Profile.Profile,TM_User.Report_To, Reference.lookupvalue as platform, STUFF(( SELECT ', ' + Reference_Skills.SkillLookupValue FROM Reference_Skills JOIN TM_UserAttributeValue ON TM_UserAttributeValue.AttributeValue = Reference_Skills.SkillLookupValue WHERE Reference_Skills.SkillLookupKey = Reference.LookupID AND TM_UserAttributeValue.AttributeKeyType = TM_UserAttributeValue.AttributeKeyType AND TM_UserAttributeValue.TM_UserID = TM_User.TM_UserID FOR XML PATH('') ) ,1,2,'') as skills FROM TM_User JOIN TM_UserAttributeValue ON TM_UserAttributeValue.TM_UserID = TM_User.TM_UserID and TM_UserAttributeValue.AttributeKeyType = 'Skill' JOIN Reference_Skills ON Reference_Skills.SkillLookupValue = TM_UserAttributeValue.AttributeValue JOIN Reference on Reference.LookupID = Reference_Skills.SkillLookupKey join TM_Profile on TM_Profile.ProfileID=TM_User.ProfileID join task on project.project_id=task.project_id join timesheet on timesheet.task_id=task.task_id WHERE TM_User.Is_Active=1 and TM_User.TM_UserID=13 GROUP BY Reference.LookupID, Reference.LookupValue, TM_User.TM_UserID, TM_User.FullName, TM_UserAttributeValue.AttributeKeyType,TM_Profile.Profile, TM_User.Report_To
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)