Category: PIPER-RX Managing Workflows Paper 2008 Name: MWP006 - Step 3B - Aged Workflows By Workflow (Days) ReportDefFileName: .\MWP006 - Step 3B - Aged Workflows By Workflow (Days).fr3 ===Begin Comments=== Copyright (C) 2009 G Piper This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. a copy of the GNU Affero General Public Licenses provided is part of the down load Terms and Conditions available on our site www.piper-rx.com or you can refere to www.gnu.org/licenses/gpl.html ===End Comments=== ===Begin SQL=== -- **************************************************** -- ** PIPER-RX - Managing Workflows Paper -- ** -- ** Copyright (C) 2008 G.Piper -- ** -- ** Step 3B- Aged Workflows By Workflow (Days) -- ** -- ** Version 1.0 Nov-08 G.Piper - PIPER-Rx -- **************************************************** SELECT to_char(sysdate, 'DD-Mon-YY HH24:MI') report_date, wi.item_type workflow, substr(witt.display_name,1,60) display_name, wi.item_key , to_char(wi.begin_date, 'DD-Mon-YY HH24:MI') begin_date, decode(trunc((sysdate - wi.begin_date)), 0, 1, 0) current_day, decode(trunc((sysdate - wi.begin_date)), 1, 1, 2, 1, 3, 1, 4, 1, 5, 1, 0) day_one_five, decode(trunc((sysdate - wi.begin_date)), 6, 1, 7, 1, 8, 1, 9, 1, 10, 1,0) day_six_ten, decode(trunc((sysdate - wi.begin_date)), 11, 1, 12, 1, 13, 1, 14, 1, 15, 1,0) day_eleven_fifteen, decode(trunc((sysdate - wi.begin_date)), 16, 1, 17, 1, 18, 1, 19, 1, 20, 1,0) day_sixteen_twenty, decode(trunc((sysdate - wi.begin_date)), 21, 1, 22, 1, 23, 1, 24, 1, 25, 1,0) day_twentyone_twentyfive, decode(trunc((sysdate - wi.begin_date)), 26, 1, 27, 1, 28, 1, 29, 1, 30, 1, 31, 1, 0) day_twentysix_eom, decode(sign(trunc((sysdate - wi.begin_date) - 31)), 1,1,0) older FROM applsys.wf_items wi, applsys.wf_item_types_tl witt WHERE wi.end_date is null -- Active workflows and wi.item_type = witt.name and witt.language = userenv('LANG') and wi.item_type = upper(:WORKFLOW) ORDER by wi.begin_date ===End SQL=== ParamName: workflow ParamType: String ParamValue: apexp ParamExp: ===Begin Report Definition===