Re: Query to show me the reached Workflow dates of the projects and requests (243 Views)
Reply
Frequent Advisor
Ramazan1
Posts: 68
Registered: ‎09-04-2012
Message 1 of 2 (265 Views)
Accepted Solution

Query to show me the reached Workflow dates of the projects and requests

Hello,

 

I have a query which shows me the dates, when the project reached a status.

 

SELECT LAST_UPDATE_DATE,
  STEP_NAME,
FROM kwfl_step_transaction_hist_v
WHERE TOP_INSTANCE_SOURCE_TYPE_CODE = 'IR'
AND CURRENT_FLAG                    = 'Y'
AND TOP_INSTANCE_SOURCE_SET_ID      = 30874
ORDER BY step_transaction_history_id;

 

In this query I get all workflowstatus and  -dates for the project (ID = 30874)  in a VERTICAL structure. How can I get the result in a HORIZONTAL structure. I tried with the function DECODE but it didn't work.

 

now I get the result:

last_update_date    |      step_name

12.01.13                   |      Projectstart

14.02.13                   |      SRS Creation

..

..

 

I want to get:

Projectstart               |     SRS Creation    .....

12.01.13                   |     14.02.13          .....

 

Of course I need the results for the projects and requests. that means that I need the project_name, project_id or request_id.

 

Thank you for your help.

 

Regards,

Ramazan

Please use plain text.
Honored Contributor
Utkarsh_Mishra
Posts: 686
Registered: ‎07-13-2010
Message 2 of 2 (243 Views)

Re: Query to show me the reached Workflow dates of the projects and requests

With SQL alone it will be little challenging. You can do this easily in PL/SQL.

 

I found this site useful to get it done via SQL alone, you can refer it. 

 

http://stackoverflow.com/questions/9155033/sql-turning-rows-into-columns

 

Hope this help.

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation