Try this out:
SELECT ProjectOwner.ResourceName AS PM,
Resource.ResourceName AS Resource,
MSP_EpmProject_UserView.ProjectName AS Project,
MSP_EpmTask_UserView.TaskName AS Task,
CONVERT(varchar(10), MSP_EpmTask_UserView.TaskStartDate, 101) AS [Task
Start Date],
CONVERT(varchar(10), MSP_EpmTask_UserView.TaskFinishDate, 101)
AS [Task Finish Date],
CONVERT(varchar(10), MSP_TimeByDay.TimeByDay, 101) AS [Assignment Date],
MSP_EpmTask_UserView.TaskActualWork AS [Actual Work],
MSP_EpmTask_UserView.TaskRemainingWork AS [Remaining Work],
MSP_EpmTask_UserView.TaskWork AS [Work],
MSP_EpmProject_UserView.ProjectUID,
MSP_EpmTask_UserView.TaskUID,
MSP_EpmAssignment_UserView.AssignmentUID,
Resource.ResourceUID,
ProjectOwner.ResourceUID AS PMUID
FROM MSP_EpmTask_UserView INNER JOIN
MSP_EpmProject_UserView ON
MSP_EpmProject_UserView.ProjectUID = MSP_EpmTask_UserView.ProjectUID INNER
JOIN
MSP_EpmAssignment_UserView ON
MSP_EpmAssignment_UserView.TaskUID = MSP_EpmTask_UserView.TaskUID INNER JOIN
MSP_EpmResource_UserView AS Resource ON
Resource.ResourceUID = MSP_EpmAssignment_UserView.ResourceUID INNER JOIN
MSP_EpmResource_UserView AS ProjectOwner ON
ProjectOwner.ResourceUID = MSP_EpmProject_UserView.ProjectOwnerResourceUID
LEFT JOIN
MSP_EpmAssignmentByDay_UserView ON
MSP_EpmAssignmentByDay_UserView.AssignmentUID =
MSP_EpmAssignment_UserView.AssignmentUID LEFT JOIN
MSP_TimeByDay ON MSP_EpmAssignmentByDay_UserView.TimeByDay =
MSP_TimeByDay.TimeByDay
--
Chris Boyd
MS Project
Program Manager
Blog:
http://blogs.msdn.com/project_programmability/