oracle8.1.6 select tt.creation_user as user_id, acs_object.name(tt.creation_user) as user_name, count(ticket_id) as total, sum(decode(lower(wfc.state),'active',1,0)) as active, sum(decode(lower(wfc.state),'suspended',1,0)) as suspended, sum(decode(lower(wfc.state),'canceled',1,0)) as canceled, sum(decode(lower(wfc.state),'finished',1,0)) as finished, max(tt.creation_date) as latest, min(tt.creation_date) as earliest from ttracker_tickets tt, ttracker_categories tc, wf_cases wfc where tc.package_id = :package_id and tt.category_id = tc.category_id and tt.ticket_id = wfc.object_id [ad_dimensional_sql $dimensional] group by tt.creation_user [ad_order_by_from_sort_spec $orderby $table_def] tt.creation_date + 365 > sysdate tt.creation_date + 90 > sysdate tt.creation_date + 30 > sysdate