I have the following code in External Data Connections for Excel: It retrieves the resources from MS Project and repeats the same task in the table for however many resources there are, which is what I don't want. How can I display all resources for the same task in one line from the SQL Query:
For example:
Current Display:
Task______________Resource
Prep Work____________Room A
Prep Work____________Room B
Prep Work____________Room C
What I want is:
Task_________________Resource
Prep Work_______________Room A, Room B, Room C
Code Is Outlined Below:
SELECT DISTINCT P_ProjectDetails.Client AS 'Client',
P_ProjectDetails.Product AS 'Product',
T.[Project Reference] AS 'Project Number',
A.ResourceName AS 'Resource',
T.TaskName AS 'Task',
T.TaskStartDate AS 'Start',
T.TaskFinishDate AS 'Finish',
T.[Lot Number],
FROM dbo.MSP_EpmProject_UserView P,
dbo.MSP_EpmTask_UserView T
LEFT OUTER JOIN dbo.MSP_EpmProject_UserView P_ProjectDetails
ON T.[Project Reference]=P_ProjectDetails.[Project Number]
LEFT OUTER JOIN dbo.MSP_EpmAssignment_UserView A
ON A.TaskUID=T.TaskUID
WHERE P.ProjectUID=T.ProjectUID
AND P.ProjectName = 'Operation Schedule of All Projects'
--AND T.[Project Reference] IS NOT NULL
--AND A.ResourceName NOT IN ('Unassigned Resource','Local Generic Resource')
ORDER BY 1, 2
http://www.msofficeforums.com/excel/...html#post87171
Bookmarks