Display all tasks and their outline codes

M

mtran66

Hello,

I've been trying to create an SQL query that would show me task names
and their outline codes.

I made a query that does do something that I want, However, it does
not display all the projects in the database:

SELECT
MSP_TASKS.TASK_NAME,
MSP_OUTLINE_CODES.OC_
NAME,MSP_PROJECTS.PROJ_NAME
FROM
MSP_TASKS INNER JOIN MSP_CODE_FIELDS
ON MSP_TASKS.TASK_UID = MSP_CODE_FIELDS.CODE_REF_UID
AND MSP_TASKS.PROJ_ID = MSP_CODE_FIELDS.PROJ_ID

INNER JOIN MSP_OUTLINE_CODES
ON MSP_CODE_FIELDS.CODE_UID = MSP_OUTLINE_CODES.CODE_UID
AND MSP_CODE_FIELDS.PROJ_ID = MSP_OUTLINE_CODES.PROJ_ID

INNER JOIN MSP_PROJECTS
ON MSP_PROJECTS.PROJ_ID = MSP_TASKS.PROJ_ID

Does anyone have a query that displays all tasks and the associated
outline codes that are associated with it?
 
M

mtran66

Hello,

I've been trying to create an SQL query that would show me task names
and their outline codes.

I made a query that does do something that I want, However, it does
not display all the projects in the database:

SELECT
        MSP_TASKS.TASK_NAME,
        MSP_OUTLINE_CODES.OC_
        NAME,MSP_PROJECTS.PROJ_NAME
FROM
        MSP_TASKS INNER JOIN MSP_CODE_FIELDS
                ON MSP_TASKS.TASK_UID = MSP_CODE_FIELDS.CODE_REF_UID
                AND MSP_TASKS.PROJ_ID = MSP_CODE_FIELDS.PROJ_ID

        INNER JOIN MSP_OUTLINE_CODES
                ON MSP_CODE_FIELDS.CODE_UID = MSP_OUTLINE_CODES.CODE_UID
                AND MSP_CODE_FIELDS.PROJ_ID = MSP_OUTLINE_CODES.PROJ_ID

        INNER JOIN MSP_PROJECTS
                ON MSP_PROJECTS.PROJ_ID = MSP_TASKS.PROJ_ID

Does anyone have a query that displays all tasks and the associated
outline codes that are associated with it?

I am using MSP2003
 
C

Chak

Hello,

I've been trying to create an SQL query that would show me task names
and their outline codes.

I made a query that does do something that I want, However, it does
not display all the projects in the database:

SELECT
        MSP_TASKS.TASK_NAME,
        MSP_OUTLINE_CODES.OC_
        NAME,MSP_PROJECTS.PROJ_NAME
FROM
        MSP_TASKS INNER JOIN MSP_CODE_FIELDS
                ON MSP_TASKS.TASK_UID = MSP_CODE_FIELDS.CODE_REF_UID
                AND MSP_TASKS.PROJ_ID = MSP_CODE_FIELDS.PROJ_ID

        INNER JOIN MSP_OUTLINE_CODES
                ON MSP_CODE_FIELDS.CODE_UID = MSP_OUTLINE_CODES.CODE_UID
                AND MSP_CODE_FIELDS.PROJ_ID = MSP_OUTLINE_CODES.PROJ_ID

        INNER JOIN MSP_PROJECTS
                ON MSP_PROJECTS.PROJ_ID = MSP_TASKS.PROJ_ID

Does anyone have a query that displays all tasks and the associated
outline codes that are associated with it?

Hello,

You are using Inner Join, so you will see the only projects which have
task outline codes. Modify the last join condition as follows to view
the all projects in database.

RIGHT OUTER JOIN
MSP_PROJECTS ON MSP_PROJECTS.PROJ_ID =
MSP_TASKS.PROJ_ID

Thanks
Chak
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top