Category: PIPER-RX Managing Workflows Paper 2008 Name: MWP003 - Step 2A - Aged Workflows (Months) ReportDefFileName: .\MWP003 - Step 2A - Aged Workflows (Months).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 2A - Aged Workflows (Months) -- ** -- ** 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,50) display_name, count(*) sample_size, round(max(sysdate - wi.begin_date),0) oldest_workflow_days, sum(decode( trunc(months_between (sysdate, wi.begin_date)), 0, 1, 0 )) "Current", sum(decode( trunc(months_between (sysdate, wi.begin_date)), 1, 1, 0 )) "30 Day", sum(decode( trunc(months_between (sysdate, wi.begin_date)), 2, 1, 0 )) "60 Day", sum(decode( trunc(months_between (sysdate, wi.begin_date)), 3, 1, 0 )) "90 Day", sum(decode( trunc(months_between (sysdate, wi.begin_date)), null, 0, 0, 0, 1, 0, 2, 0, 3, 0, 1 )) "120 + Days" FROM applsys.wf_items wi, applsys.wf_item_types_tl witt WHERE wi.end_date is null and wi.item_type = witt.name and witt.language = userenv('LANG') Group by to_char(sysdate, 'DD-Mon-YY HH24:MI'), wi.item_type, witt.display_name ORDER by wi.item_type ===End SQL=== ===Begin Report Definition===