Igor Gomes Posted December 4, 2023 Topic Count: 3 Topics Per Day: 0.01 Content Count: 11 Content Per Day: 0.04 Reputation: 0 Achievement Points: 72 Solved Content: 0 Days Won: 0 Status: Offline Age: 24 Device: Windows Report Share Posted December 4, 2023 (edited) Bom dia pessoal, tudo bem? Galera estou tentando montar uma planilha .net para trazer todos colaboradores com batidas de ponto que trabalham 7 dias seguidos Estou fazendo seguinte select: Porém quando tento acrescentar em uma planilha .net ou cadastrar na consulta ele não me deixa gera erro: Esta consulta apresentou um erro ao ser executada, deseja salvá-la assim mesmo? Detalhes técnicos: ORA-00923: palavra-chave FROM não localizada onde esperada Alguém sabe o que poderia sre ? SELECT B.NOME AS "nome", A.CHAPA AS "Chapa", EXTRACT(MONTH FROM A."DATA") AS "Mês", EXTRACT(YEAR FROM A."DATA") AS "Ano", COUNT(DISTINCT TRUNC(A."DATA")) AS "Dias Trabalhados" FROM ABATFUN A INNER JOIN PFUNC B ON A.CHAPA = B.CHAPA WHERE B.CHAPA = :chapa AND EXTRACT(MONTH FROM A."DATA") = :MES AND EXTRACT(YEAR FROM A."DATA") = :ANO GROUP BY B.NOME, A.CHAPA, EXTRACT(YEAR FROM A."DATA"), EXTRACT(MONTH FROM A."DATA"), TO_CHAR(A."DATA", 'IYYY-IW') HAVING COUNT(DISTINCT TRUNC(A."DATA")) = 7 ORDER BY B.NOME; Edited December 4, 2023 by Igor Gomes Quote Link to comment Share on other sites More sharing options...
omar Posted December 4, 2023 Topic Count: 59 Topics Per Day: 0.01 Content Count: 824 Content Per Day: 0.16 Reputation: 108 Achievement Points: 4,812 Solved Content: 0 Days Won: 75 Status: Offline Age: 61 Device: Windows Report Share Posted December 4, 2023 Tenta assim: SELECT B.NOME AS NOME, A.CHAPA AS CHAPA, Datepart(MONTH, A.DATA) AS MES, Datepart(YEAR, A.DATA) AS ANO, Count(A.DATA) AS DIASTRALHADO FROM ABATFUN AS A WITH (NOLOCK) INNER JOIN PFUNC AS B WITH (NOLOCK) ON A.CHAPA = B.CHAPA WHERE B.CHAPA = :CHAPA AND Datepart(MONTH, A.DATA) = :MES AND Datepart(YEAR, A.DATA) = :ANO GROUP BY B.NOME, A.CHAPA, Datepart(YEAR, A.DATA), Datepart(MONTH, A.DATA) HAVING Count(A.DATA) = 7 ORDER BY B.NOME Quote Link to comment Share on other sites More sharing options...
omar Posted December 4, 2023 Topic Count: 59 Topics Per Day: 0.01 Content Count: 824 Content Per Day: 0.16 Reputation: 108 Achievement Points: 4,812 Solved Content: 0 Days Won: 75 Status: Offline Age: 61 Device: Windows Report Share Posted December 4, 2023 Vi agora que teu banco é ORACLE. Enviei select do MS SQL Server. Quote Link to comment Share on other sites More sharing options...
Igor Gomes Posted December 4, 2023 Topic Count: 3 Topics Per Day: 0.01 Content Count: 11 Content Per Day: 0.04 Reputation: 0 Achievement Points: 72 Solved Content: 0 Days Won: 0 Status: Offline Age: 24 Device: Windows Author Report Share Posted December 4, 2023 @omar tentei executar conforme me orientou e mesmo assim retornei com o mesmo erro Detalhes técnicos: ORA-00923: palavra-chave FROM não localizada onde esperada Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.