Ir para conteúdo

Maccio

Members
  • Total de itens

    2
  • Registro em

  • Última visita

Tudo que Maccio postou

  1. Maccio

    Funcionários Férias

    Estou tentando criar um relatório com total de horas trabalhadas do funcionários por dia, tenho uma tabela FRQ_digitacao onde eu tenho os dados para calcular o total de horas e se tiver com zero horas eu digo a ocorrência do mesmo, ex: falta, Folga, etc. Quero também colocar a informação de férias quando o mesmo estiver de férias, porém quando ele está de férias a tabela FRQ_digitacao fica sem registros nos dias de Férias, assim tenho que buscar a informação na tabela FLP_Ferias onde é lá que diz o gozoinicial e gozofinal, porém não estou conseguindo fazer essa comparação já que na tabela FRQ_digitacao nesses dias de ferias o funcionário fica sem registro. select T.CODINTFUNC, f.CHAPAFUNC, LISTAGG( CASE WHEN T.NORMALDIGIT=0 THEN OC.DESCMAPAOCORR WHEN t.DTDIGIT IS NULL THEN 'dt.dtdigit' --when dt.dtdigit between fe.inicio and fe.fim --then 'FER' ELSE to_char((TRUNC(T.NORMALDIGIT)+TRUNC(t.extradigit)+TRUNC(t.extranotdigit))+ ((trunc(((T.NORMALDIGIT-trunc(T.NORMALDIGIT))+(t.extradigit-trunc(t.extradigit))+(t.extranotdigit-trunc(t.extranotdigit)))/0.60))+ mod(((T.NORMALDIGIT - trunc(T.NORMALDIGIT))+(t.extradigit - trunc(t.extradigit))+(t.extranotdigit - trunc(t.extranotdigit))),0.60)),'FM99999D90', 'nls_numeric_characters=''.,''' ) END, ' ') within group (order by t.dtdigit) horas, MAX(FE.INICIO), MAX(FE.FIM ) from vw_funcionarios f, FRQ_DIGITACAOMOVIMENTO O, FRQ_OCORRENCIA OC, frq_digitacao t, (select f.codintfunc INT, f.chapafunc, max(fe.dtcompetfer)COMPET, MAX(fe.gozoinifer) INICIO, MAX(fe.Gozofinfer) FIM from flp_ferias fe, flp_funcionarios f where f.codintfunc=fe.codintfunc AND F.SITUACAOFUNC='A' and f.codigoempresa=1 AND FE.STATUSFERIAS='N' group by f.chapafunc, f.codintfunc) FE, (select t.DTDIGIT from frq_digitacao t WHERE t.dtdigit between '01-NOV-2019' AND '20-NOV-2019' group by t.dtdigit) DT where DT.DTDIGIT(+)=T.dtdigit and fe.INT=t.codintfunc and f.codintfunc=t.codintfunc AND F.CODIGOEMPRESA=1 and O.CODINTFUNC=T.CODINTFUNC AND T.DTDIGIT=O.DTDIGIT AND O.CODOCORR=OC.CODOCORR AND dt.dtdigit BETWEEN '01-NOV-2019' AND '20-NOV-2019' -- AND F.CODDEPTO BETWEEN 15 AND 15 AND O.STATUSDIGIT='N' and o.iddigit = (select max(p.iddigit) from frq_digitacaomovimento p where o.codintfunc=p.codintfunc and o.dtdigit=p.dtdigit AND P.STATUSDIGIT='N' and p.dtdigit between '01-NOV-2019' AND '20-NOV-2019') group by f.CHAPAFUNC, T.CODINTFUNC
  2. Maccio

    Funcionários Férias

    Não deu certo Mota, continua o mesmo resultado.
×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.