|
Posted by Ed Murphy on 08/20/06 22:34
On 15 Aug 2006 11:05:42 -0700, "DarkHades" <hades5k@gmail.com> wrote:
>The tables belong to MS Project 2003. You can have projects and Web
>project. My application uses web project, but the problem is that web
>project must be linked to project to uses Outline Codes (user defined
>values). I need to retrieve all the tasks (MSP_VIEW_PROJ_TASKS_STD) for
>a specific user (passed as @resourceName) which is stored in that table
>in column TaskResourceNames (yes, if there's more resource assigned to
>a task, they're all there seperate with a comma).
Find out whether Project will let you normalize this.
>I must retrieve these
>data for a specific department which is stored is the
>MSP_OUTLINE_CODES.
>
>MSP_OUTLINE_CODES is used to hold departments as well as other
>information which is also required in the query.
>
>So basically, I need to get all the tasks from MSP_VIEW_PROJ_TASKS_ENT
>different from -1. Then I need to filter the result so that only the
>task for a specific enterprise is there (passed as @companyName). That
>information is stored in the MSP_OUTLINE_CODES too. But there's more.
>In that filtered result, I must look if the resource is assigned to it
>(@resourceName) and if so, I must query again MSP_OUTLINE_CODES to get
>the department. And then, I must return values from every step.
The core of your code appears to be as follows:
select <stuff>
into <temp table>
from MSP_VIEW_PROJ_TASKS_ENT as tasks
join MSP_OUTLINE_CODES as codes
on codes.CODE_UID = tasks.TaskEnterpriseOutlineCode1ID
join MSP_VIEW_PROJ_TASKS_STD as taskStd
on taskStd.WPROJ_ID = tasks.WPROJ_ID
and taskStd.TaskUniqueID = tasks.ENT_TaskUniqueID
where <stuff>
What are the primary keys of these three tables?
Show a few rows from each of these three tables, then show the data
that ends up in the temp table based on those rows.
[Back to original message]
|