Click here to Skip to main content
15,917,618 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
SQL
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
Posted
Comments
Member 10501509 3-Jan-14 9:38am    
The multi-part identifier "project.project_id" could not be bound.

join task on project.project_id=task.project_id

You are missing your join to the project table. So SQL doesn't know what project.project_id is, it's missing from the table list.
 
Share this answer
 
in your one of the join

join task on project.project_id=task.project_id

where is the project table specified?
 
Share this answer
 
Comments
Christian Graus 3-Jan-14 16:13pm    
Don't push 'answer' to ask a question. I nearly did not read this, thinking it had been answered.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900