jaaret
Instructor
- Jun 19, 2002
- 171
I'm using Access to analyze a MS Project 2007 project plan. I'm writing queries that I can adapt into functions to parse the project Work Breaksdown Structure (WBS) codes.
To link a Level 4 task with its parent Level 3 task I have to parse the third number in the WBS code. So far I have been able to get this to work with the complex, nested function, below:
ParWBS: Left(Right(Right([wbs],Len([wbs])-2),Len(Right([wbs],Len([wbs])-2))-InStr(1,Right([wbs],Len([wbs])-2),".")),InStr(1,Right(Right([wbs],Len([wbs])-2),Len(Right([wbs],Len([wbs])-2))-InStr(1,Right([wbs],Len([wbs])-2),".")),".")-1)
This has worked so far with Level 4 WBS codes of different lengths:
1.6.10.1 results in 10
1.6.9.2 results in 9
1.12.9.3 results in 9
Is there a simpler, more straightforward way to approach this?
If you would like a little more background, read on.
Project has a Unique_ID field which acts as a primary key. However, the Unique_ID field will re-index (not sure yet what triggers re-indexing) so using it as a primary key in Access is useless. I'm creating a primary key in Access and parsing the WBS code is my method for linking the sub-tasks with their parent tasks.
Thanks for your input!
Jaaret
To link a Level 4 task with its parent Level 3 task I have to parse the third number in the WBS code. So far I have been able to get this to work with the complex, nested function, below:
ParWBS: Left(Right(Right([wbs],Len([wbs])-2),Len(Right([wbs],Len([wbs])-2))-InStr(1,Right([wbs],Len([wbs])-2),".")),InStr(1,Right(Right([wbs],Len([wbs])-2),Len(Right([wbs],Len([wbs])-2))-InStr(1,Right([wbs],Len([wbs])-2),".")),".")-1)
This has worked so far with Level 4 WBS codes of different lengths:
1.6.10.1 results in 10
1.6.9.2 results in 9
1.12.9.3 results in 9
Is there a simpler, more straightforward way to approach this?
If you would like a little more background, read on.
Project has a Unique_ID field which acts as a primary key. However, the Unique_ID field will re-index (not sure yet what triggers re-indexing) so using it as a primary key in Access is useless. I'm creating a primary key in Access and parsing the WBS code is my method for linking the sub-tasks with their parent tasks.
Thanks for your input!
Jaaret