my code stock.com

marcus.sacramento

QR INDICADOR REABERTURA
by marcus.sacramento

Carrega ARS's que impactam o Indicador de Reabertura

Snippet options

Download: Download snippet as qr-indicador-reabertura.sql.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

SELECT  ars.c1 "ARS",Ars.C536870990 "Agente_Atual", ARS.c536871841 "Agente_Responsavel", ars.C536870993 "Tecnico",HST.c536871044 "Técnico da Reabertura",
            UPPER (REGEXP_REPLACE (REGEXP_SUBSTR (ars.C536871172, '[\{].*[\}]'),
                     '[\{]|[\}]', ''))
                "Solucao",
            UPPER (REGEXP_REPLACE (REGEXP_SUBSTR (ars.C536871172, '[<].*[>]'),
                     '[\<]|[\>]', ''))
                "Reabertura",
            DECODE (ars.C7, 0, 'Novo', 1, 'Designado', 2, 'Em Andamento', 3,
            'Pendente', 4, 'Redesignado', 5, 'Escalonado', 6, 'Contingenciado',
            7, 'Resolvido', 8, 'Fechado', 9, 'Cancelado')
                "Status ARS"
  FROM  t90 ars, T92 HST
 WHERE  1 = 1
            AND HST.c536870917 =
                    (SELECT  MAX (c536870917)
                        FROM     t92
                      WHERE       c536870917 < ARS.C536870936
                                 AND c536870914 IN (7, 9)
                                 AND c536870913 = ARS.C1)
            AND HST.c536870913 = ARS.C1

                       AND ( ( (   Ars.C536870990 LIKE 'OPERACAO_INV_%'
                        OR Ars.C536870990 = 'SUPORTE_FIX_CLARIFY'
                        OR Ars.C536870990 = 'OPERACAO_SUP_GECO'
                        OR Ars.C536870990 = 'SUPORTE_GECO_FIX'
                        OR Ars.C536870990 = 'SUPORTE_MIGRACAO_CRM_FIX')
                     AND ARS.C536870990 NOT LIKE 'OPERACAO_INV%PROATIVO%'
                     AND ARS.C536870990 NOT LIKE '%SAC%'
                          AND ARS.C536870990 NOT LIKE '%EAI%')
                  OR ( (    ARS.c536871841 LIKE 'OPERACAO_INV_%'
                          AND ARS.c536871841 NOT LIKE '%SAC%'
                          AND ARS.c536871841 NOT LIKE '%EAI%'
                          )
                       ))
            
            AND ARS.C536870936 >
                    ( (TO_DATE ('25/07/2011 00:00:00', 'DD/MM/YYYY HH24:MI:SS')
                        - TO_DATE ('31/12/1969 21:00:00', 'DD/MM/YYYY HH24:MI:SS'))
                     * 86400)
            AND ARS.C536871173 != 2
            AND ARS.c536871023 = 0
            AND ars.C7 IN (7, 8)    
            AND (CASE
                      WHEN TO_DATE ('31/12/1969 21:00:00',
                             'DD/MM/YYYY HH24:MI:SS')
                             + ARS.C536870936 / (24 * 60 * 60) <= TO_DATE ('24/07/2011',
                                                                              'DD/MM/YYYY') AND Ars.C536870990 LIKE 'OPERACAO_INV_%' 
                      THEN
                          'Desconsiderar'
                  END) IS NULL
--AND ARS.C1 in('');

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.