HElp with the answer to the following...
TRS table weekhours currently has several fields including the following (simplified structure):
Assoc_ID
Project_ID
Category_code
Hours
If an associate (ABC) enters 4 hours productive, 2 hours TAFW, 2 hours idle and
another associate (DEF) enters 6 hours productive, 1 hours TAFW, 1 hours idle
then weekhours looks like this.
Assoc Proj Cat Hours
ABC XYZ PROD 4
ABC XYZ TAFW 2
ABC XYZ IDLE 2
DEF XYZ PROD 6
DEF XYZ TAFW 1
DEF XYZ IDLE 1
Assuming there are only 3 categories (not to be changed in next 5 years), you have to report this vertical storage as horizontal as follows:
Assoc Proj Prod TAFW IDLE
ABC XYZ 4 2 2
DEF XYZ 6 1 1
Condition - Only one select allowed. No temp table allowed. Hardcoding on CAT field is allowed.
TRS table weekhours currently has several fields including the following (simplified structure):
Assoc_ID
Project_ID
Category_code
Hours
If an associate (ABC) enters 4 hours productive, 2 hours TAFW, 2 hours idle and
another associate (DEF) enters 6 hours productive, 1 hours TAFW, 1 hours idle
then weekhours looks like this.
Assoc Proj Cat Hours
ABC XYZ PROD 4
ABC XYZ TAFW 2
ABC XYZ IDLE 2
DEF XYZ PROD 6
DEF XYZ TAFW 1
DEF XYZ IDLE 1
Assuming there are only 3 categories (not to be changed in next 5 years), you have to report this vertical storage as horizontal as follows:
Assoc Proj Prod TAFW IDLE
ABC XYZ 4 2 2
DEF XYZ 6 1 1
Condition - Only one select allowed. No temp table allowed. Hardcoding on CAT field is allowed.