Category: PIPER-Rx Reports (Free) Name: FWF001-11 Aged Workflows (Months) ReportDefFileName: .\FWF001-11 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 - Free Reports -- ** -- ** Copyright (C) 2009 G.Piper -- ** -- ** From AUSOAUG eTraining Webcast By G.Piper - November 2008 -- ** -- ** Step 1 Aged Workflows -- ** -- ** ------------------------------------------------- -- ** Version 1.0 Nov-08 G.Piper - PIPER-Rx -- ** Version 1.1 Aug-09 G.Piper Referenced GV$DATABASE -- **************************************************** SELECT to_char(sysdate, 'DD-Mon-YY HH24:MI') report_date, report_headings.sid_name, 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, (SELECT vd.name sid_name FROM gv$database vd WHERE vd.inst_id = 1 ) report_headings 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'), report_headings.sid_name, wi.item_type, witt.display_name ORDER by wi.item_type ===End SQL=== ===Begin Report Definition===