View Single Post
 
Old 08-19-2015, 06:27 PM
AKent AKent is offline Windows 7 32bit Office 2013
Novice
 
Join Date: Aug 2015
Posts: 3
AKent is on a distinguished road
Default MS Excel - SQL Data Query Connection to MS Project - Resource Displayed in Multiple lines not in one

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
Execution Room D
Execution Room E

What I want is:
Task Resource
Prep Work Room A, Room B, Room C
Execution Room D, Room E


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.excelforum.com/excel-gene...-one-line.html

Last edited by AKent; 08-20-2015 at 05:36 AM.
Reply With Quote