Now that you got direct access to the Microsoft Project data from Microsoft Excel, you’re faced with tens of funny named tables and their attributes. I’ll show you how to sort out this mess to find what you’re looking for.
Let’s start with basics. Microsoft Project database can hold data for many projects. To list which project are in the database, you would construct a query like this:
SELECT MSP_PROJECTS.PROJ_NAME
FROM `D:\My Documents\Sample Project\SOFTDEV`.MSP_PROJECTS MSP_PROJECTS
To make these SELECT statements readable, I will be leaving out file paths. I’ll also use shorter table alias, but don’t worry about this, as this is legal SQL syntax.
In short:
SELECT P.PROJ_NAME
FROM MSP_PROJECTS P
The output will be something like:
How do you actually construct a query in Microsoft Query?
- When Microsoft Query is started, you’re automatically presented with Add Tables dialog box.
- Select the table you want to work with and click Add.
- Repeat this for all tables, you need for a specific query.
- Click Close when you’re finished.
You can always bring back Add Tables dialog box by clicking Add Table(s) button in the toolbar or by selecting Table and Add Tables from the menu.
Selected tables are shown in the upper pane of the Query window.
If you want to remove the table, select it and press Delete key, or select Table and Remove Table from the menu.
To choose which fields you weant to see in the query result, find each field in tables and double click it. Selected field will show in the Query Pane of the window.
To remove a field, click it and press Delete key.
Now let’s get task list out of database.
- Add tables MSP_PROJECTS and MSP_TASKS.
- Add field TASK_NAME from MSP_TASKS table.
If database contains only one project, then this query is fine, but if there is more than one project in the database, you may not be happy with a list of tasks, without knowing which task belongs to which project.
You have two options.
- Add field PROJ_NAME from table MSP_PROJECTS. This will now produce a table with two fields, first will be Task Name and the second will be Project Name.
- In case you only want tasks for a specific project, click Show/Hide Criteria to show Criteria Pane and then drag PROJ_NAME field from table MSP_PROJECTS to first column in the Criteria Field. One row below in the Value field, type the name of the project, for which you want to retrieve tasks.

You might also want to order the records. Select Records and Sort from the menu and add MSP_TASKS.TASK_ID in the ascending order to the sort list.
You will notice a couple of strange records. These are used by Project and should be ignored. You can eliminate them by adding another criteria into criteria table: MSP_TASKS.TASK_UID >= 0.
SQL statement for that query looks like this:
SELECT T.TASK_UID, T.TASK_NAME
FROM MSP_PROJECTS P, MSP_TASKS T
WHERE T.PROJ_ID = P.PROJ_ID AND ((P.PROJ_NAME='SOFTDEV') AND (T.TASK_ID>=0))
ORDER BY T.TASK_ID
Let’s now add some duration, work, start and finish information to the tasks. Add fields TASK_DUR, TASK_WORK, TASK_START_DATE and TASK_FINISH_DATE from MSP_TASKS to the query output.
You will notice some weird numbers for duration and work. This is because duration, work, rate, and cost values can be displayed using different units, Microsoft Project saves each using a standard multiple:
- Duration values are saved as minutes * 10. Eight hours would be saved as 4800 (that is, 8*60*10).
- Work values are saved as minutes * 1000. Eight hours would be saved as 480000 (that is, 8*60*1000).
- Rate values are saved as units per hour. For example, fifteen dollars an hour would be saved as 15.
- Cost fields are saved as units * 100. For example, seventy dollars and twenty-five cents would be saved as 7025.
But if we wanted to convert duration and work into let say days, we also need to know, how many hours (or minutes) are in a workday. We need project settings.
MSP_PROJECTS table has a couple of fields, which you can use to convert time units:
- PROJ_OPT_MINUTES_PER_DAY, number of minutes in a working day,
- PROJ_OPT_MINUTES_PER_WEEK, number of minuets in a working week,
- and PROJ_OPT_DAYS_PER_DAY, number of working days in a month.
For example, to show duration and work, you would double click TASK_DUR in a Query pane and replace MSP_TASKS.TASK_DUR with MSP_TASKS.TASK_DUR/MSP_PROJECTS.PROJ_OPT_MINUTES_PER_DAY/10. Also replace MSP_TASKS.TASK_WORK with MSP_TASKS.TASK_WORK/MSP_PROJECTS.PROJ_OPT_MINUTES_PER_DAY/1000.
Our SQL statement has now turned into the following monster:
SELECT T.TASK_ID, T.TASK_NAME, T.TASK_DUR/P.PROJ_OPT_MINUTES_PER_DAY/10, T.TASK_WORK/P.PROJ_OPT_MINUTES_PER_DAY/1000, T.TASK_START_DATE, T.TASK_FINISH_DATE
FROM MSP_PROJECTS P, MSP_TASKS T
WHERE T.PROJ_ID = P.PROJ_ID AND ((P.PROJ_NAME='SOFTDEV') AND (T.TASK_UID>=0))
ORDER BY T.TASK_ID
To make the output a bit more readable, you can rename the column headings. Double click each of them and provide a more descriptive name in Column heading.
Now you can explore the rest of the tables and fields on your own. I’ll present some tips and tricks in future posts. In the meantime explore Microsoft Office Project 2003 Data Reference
located on your disk in something similar to C:\Program Files\Microsoft Office\OFFICE11\1033\PJDB.HTM for a detailed description of the project database. You might as well download Microsoft Office Project 2003 Database Schema.