Perguntas Relatório de Demitidos
- diegoo_martins
- Autor do Tópico
- Desconectado
- Membro Dourado
Menos
Mais
- Postagens: 175
- Obrigados Recebidos: 0
4 anos 3 meses atrás #32911
por diegoo_martins
Relatório de Demitidos foi criado por diegoo_martins
Pessoal, boa noite!
Preciso inserir 3 colunas no relatório de demitidos (anexo). Estas 3 colunas devem constar 3 verbas diferentes..Exemplo:
Verba 565 - Liquido Rescisão
Verba 714 - Saldo Fgts
Verba 715 - Fgts Artigo 22
Já tentei de tudo, alguém pode me ajudar?
Obrigado.
Preciso inserir 3 colunas no relatório de demitidos (anexo). Estas 3 colunas devem constar 3 verbas diferentes..Exemplo:
Verba 565 - Liquido Rescisão
Verba 714 - Saldo Fgts
Verba 715 - Fgts Artigo 22
Já tentei de tudo, alguém pode me ajudar?
Obrigado.
Por favor Acessar ou Registrar para participar da conversa.
- diegoo_martins
- Autor do Tópico
- Desconectado
- Membro Dourado
Menos
Mais
- Postagens: 175
- Obrigados Recebidos: 0
4 anos 3 meses atrás #32912
por diegoo_martins
Respondido por diegoo_martins no tópico Relatório de Demitidos
Pessoa, bom dia!
Consegui trazer apenas as 3 verbas em colunas diferentes, porém traz em linhas diferentes. Tem como gerar as 3 verbas na mesma linha?
Segue Query:
cQuery += " SELECT DISTINCT " + CRLF
cQuery += " RA_FILIAL, " + CRLF
cQuery += " RA_MAT, " + CRLF
cQuery += " RA_NOME, " + CRLF
cQuery += " RA_CC, " + CRLF
cQuery += " CTT_DESC01," + CRLF
cQuery += " RA_ADMISSA," + CRLF
cQuery += " RA_SALARIO," + CRLF
cQuery += " RA_SINDICA," + CRLF
cQuery += " RCE_DESCRI," + CRLF
cQuery += " RA_DEMISSA," + CRLF
cQuery += " RG_DATADEM," + CRLF
cQuery += " RG_EFETIVA," + CRLF
cQuery += " RG_TIPORES, " + CRLF
cQuery += " RR_PD, " + CRLF
cQuery += " RR_VALOR " + CRLF
cQuery += " FROM SRA010 SRA " + CRLF
cQuery += " inner join CTT010 CTT on RA_CC = CTT_CUSTO " + CRLF
cQuery += " inner join RCE010 RCE on RA_SINDICA = RCE_CODIGO " + CRLF
cQuery += " inner join SRG010 SRG on RA_FILIAL = RG_FILIAL and RA_MAT = RG_MAT and RA_DEMISSA = RG_DATADEM " + CRLF
cQuery += " inner join SRR010 SRR on RA_MAT = RR_MAT and RA_DEMISSA = RR_DATA " + CRLF
cQuery += " where RA_DEMISSA <> ''" + CRLF
cQuery += " and SRR.RR_PD IN (565,714,715) " +CRLF
cQuery += " and SRA.D_E_L_E_T_ = ''" + CRLF
cQuery += " and SRG.D_E_L_E_T_ = ''" + CRLF
cQuery += " and CTT.D_E_L_E_T_ = ''" + CRLF
cQuery += " and RCE.D_E_L_E_T_ = ''" + CRLF
cQuery += " and SRR.D_E_L_E_T_ = ''" + CRLF
cQuery += " AND RA_FILIAL between '"+ MV_PAR01 + "' and '" + MV_PAR02 + "'" + CRLF
cQuery += " AND RA_MAT between '"+ MV_PAR03 + "' and '" + MV_PAR04 + "'" + CRLF
cQuery += " AND RA_CC between '"+ MV_PAR05 + "' and '" + MV_PAR06 + "'" + CRLF
cQuery += " AND RA_SINDICA between '"+ MV_PAR07 + "' and '" + MV_PAR08 + "'" + CRLF
cQuery += " AND RA_DEMISSA between '"+ DtoS(MV_PAR09) + "' and '" + DtoS(MV_PAR10) + "'" + CRLF
cQuery += " ORDER BY RA_FILIAL, RA_MAT" + CRLF
Consegui trazer apenas as 3 verbas em colunas diferentes, porém traz em linhas diferentes. Tem como gerar as 3 verbas na mesma linha?
Segue Query:
cQuery += " SELECT DISTINCT " + CRLF
cQuery += " RA_FILIAL, " + CRLF
cQuery += " RA_MAT, " + CRLF
cQuery += " RA_NOME, " + CRLF
cQuery += " RA_CC, " + CRLF
cQuery += " CTT_DESC01," + CRLF
cQuery += " RA_ADMISSA," + CRLF
cQuery += " RA_SALARIO," + CRLF
cQuery += " RA_SINDICA," + CRLF
cQuery += " RCE_DESCRI," + CRLF
cQuery += " RA_DEMISSA," + CRLF
cQuery += " RG_DATADEM," + CRLF
cQuery += " RG_EFETIVA," + CRLF
cQuery += " RG_TIPORES, " + CRLF
cQuery += " RR_PD, " + CRLF
cQuery += " RR_VALOR " + CRLF
cQuery += " FROM SRA010 SRA " + CRLF
cQuery += " inner join CTT010 CTT on RA_CC = CTT_CUSTO " + CRLF
cQuery += " inner join RCE010 RCE on RA_SINDICA = RCE_CODIGO " + CRLF
cQuery += " inner join SRG010 SRG on RA_FILIAL = RG_FILIAL and RA_MAT = RG_MAT and RA_DEMISSA = RG_DATADEM " + CRLF
cQuery += " inner join SRR010 SRR on RA_MAT = RR_MAT and RA_DEMISSA = RR_DATA " + CRLF
cQuery += " where RA_DEMISSA <> ''" + CRLF
cQuery += " and SRR.RR_PD IN (565,714,715) " +CRLF
cQuery += " and SRA.D_E_L_E_T_ = ''" + CRLF
cQuery += " and SRG.D_E_L_E_T_ = ''" + CRLF
cQuery += " and CTT.D_E_L_E_T_ = ''" + CRLF
cQuery += " and RCE.D_E_L_E_T_ = ''" + CRLF
cQuery += " and SRR.D_E_L_E_T_ = ''" + CRLF
cQuery += " AND RA_FILIAL between '"+ MV_PAR01 + "' and '" + MV_PAR02 + "'" + CRLF
cQuery += " AND RA_MAT between '"+ MV_PAR03 + "' and '" + MV_PAR04 + "'" + CRLF
cQuery += " AND RA_CC between '"+ MV_PAR05 + "' and '" + MV_PAR06 + "'" + CRLF
cQuery += " AND RA_SINDICA between '"+ MV_PAR07 + "' and '" + MV_PAR08 + "'" + CRLF
cQuery += " AND RA_DEMISSA between '"+ DtoS(MV_PAR09) + "' and '" + DtoS(MV_PAR10) + "'" + CRLF
cQuery += " ORDER BY RA_FILIAL, RA_MAT" + CRLF
Por favor Acessar ou Registrar para participar da conversa.
- diegoo_martins
- Autor do Tópico
- Desconectado
- Membro Dourado
Menos
Mais
- Postagens: 175
- Obrigados Recebidos: 0
4 anos 2 meses atrás #32916
por diegoo_martins
Respondido por diegoo_martins no tópico Relatório de Demitidos
Pessoal, resolvido!
cQuery += " SELECT " + CRLF
cQuery += " RA_FILIAL, " + CRLF
cQuery += " RA_MAT, " + CRLF
cQuery += " RA_NOME, " + CRLF
cQuery += " RA_CC, " + CRLF
cQuery += " CTT_DESC01," + CRLF
cQuery += " RA_ADMISSA," + CRLF
cQuery += " RA_SALARIO," + CRLF
cQuery += " RA_SINDICA," + CRLF
cQuery += " RCE_DESCRI," + CRLF
cQuery += " RA_DEMISSA," + CRLF
cQuery += " RG_DATADEM," + CRLF
cQuery += " RG_EFETIVA," + CRLF
cQuery += " RG_TIPORES, " + CRLF
//Alterado para atender ticket 7311 - Diego Martins
cQuery += " SRR1.RR_VALOR AS RR_VLR565, " + CRLF
cQuery += " SRR2.RR_VALOR AS RR_VLR714, " + CRLF
cQuery += " SRR3.RR_VALOR AS RR_VLR715 " + CRLF
cQuery += " FROM SRA010 SRA " + CRLF
cQuery += " inner join CTT010 CTT on RA_CC = CTT_CUSTO " + CRLF
cQuery += " inner join RCE010 RCE on RA_SINDICA = RCE_CODIGO " + CRLF
cQuery += " inner join SRG010 SRG on RA_FILIAL = RG_FILIAL and RA_MAT = RG_MAT and RA_DEMISSA = RG_DATADEM " + CRLF
cQuery += " left join SRR010 SRR1 on RA_MAT = SRR1.RR_MAT and RA_DEMISSA = SRR1.RR_DATA and SRR1.RR_PD = '565' and SRR1.D_E_L_E_T_ = '' " + CRLF
cQuery += " left join SRR010 SRR2 on RA_MAT = SRR2.RR_MAT and RA_DEMISSA = SRR2.RR_DATA and SRR2.RR_PD = '714' and SRR2.D_E_L_E_T_ = '' " + CRLF
cQuery += " left join SRR010 SRR3 on RA_MAT = SRR3.RR_MAT and RA_DEMISSA = SRR3.RR_DATA and SRR3.RR_PD = '715' and SRR3.D_E_L_E_T_ = '' " + CRLF
cQuery += " where RA_DEMISSA <> ''" + CRLF
cQuery += " and SRA.D_E_L_E_T_ = ''" + CRLF
cQuery += " and SRG.D_E_L_E_T_ = ''" + CRLF
cQuery += " and CTT.D_E_L_E_T_ = ''" + CRLF
cQuery += " and RCE.D_E_L_E_T_ = ''" + CRLF
cQuery += " AND RA_FILIAL between '"+ MV_PAR01 + "' and '" + MV_PAR02 + "'" + CRLF
cQuery += " AND RA_MAT between '"+ MV_PAR03 + "' and '" + MV_PAR04 + "'" + CRLF
cQuery += " AND RA_CC between '"+ MV_PAR05 + "' and '" + MV_PAR06 + "'" + CRLF
cQuery += " AND RA_SINDICA between '"+ MV_PAR07 + "' and '" + MV_PAR08 + "'" + CRLF
cQuery += " AND RA_DEMISSA between '"+ DtoS(MV_PAR09) + "' and '" + DtoS(MV_PAR10) + "'" + CRLF
cQuery += " ORDER BY RA_FILIAL, RA_MAT" + CRLF
cQuery += " SELECT " + CRLF
cQuery += " RA_FILIAL, " + CRLF
cQuery += " RA_MAT, " + CRLF
cQuery += " RA_NOME, " + CRLF
cQuery += " RA_CC, " + CRLF
cQuery += " CTT_DESC01," + CRLF
cQuery += " RA_ADMISSA," + CRLF
cQuery += " RA_SALARIO," + CRLF
cQuery += " RA_SINDICA," + CRLF
cQuery += " RCE_DESCRI," + CRLF
cQuery += " RA_DEMISSA," + CRLF
cQuery += " RG_DATADEM," + CRLF
cQuery += " RG_EFETIVA," + CRLF
cQuery += " RG_TIPORES, " + CRLF
//Alterado para atender ticket 7311 - Diego Martins
cQuery += " SRR1.RR_VALOR AS RR_VLR565, " + CRLF
cQuery += " SRR2.RR_VALOR AS RR_VLR714, " + CRLF
cQuery += " SRR3.RR_VALOR AS RR_VLR715 " + CRLF
cQuery += " FROM SRA010 SRA " + CRLF
cQuery += " inner join CTT010 CTT on RA_CC = CTT_CUSTO " + CRLF
cQuery += " inner join RCE010 RCE on RA_SINDICA = RCE_CODIGO " + CRLF
cQuery += " inner join SRG010 SRG on RA_FILIAL = RG_FILIAL and RA_MAT = RG_MAT and RA_DEMISSA = RG_DATADEM " + CRLF
cQuery += " left join SRR010 SRR1 on RA_MAT = SRR1.RR_MAT and RA_DEMISSA = SRR1.RR_DATA and SRR1.RR_PD = '565' and SRR1.D_E_L_E_T_ = '' " + CRLF
cQuery += " left join SRR010 SRR2 on RA_MAT = SRR2.RR_MAT and RA_DEMISSA = SRR2.RR_DATA and SRR2.RR_PD = '714' and SRR2.D_E_L_E_T_ = '' " + CRLF
cQuery += " left join SRR010 SRR3 on RA_MAT = SRR3.RR_MAT and RA_DEMISSA = SRR3.RR_DATA and SRR3.RR_PD = '715' and SRR3.D_E_L_E_T_ = '' " + CRLF
cQuery += " where RA_DEMISSA <> ''" + CRLF
cQuery += " and SRA.D_E_L_E_T_ = ''" + CRLF
cQuery += " and SRG.D_E_L_E_T_ = ''" + CRLF
cQuery += " and CTT.D_E_L_E_T_ = ''" + CRLF
cQuery += " and RCE.D_E_L_E_T_ = ''" + CRLF
cQuery += " AND RA_FILIAL between '"+ MV_PAR01 + "' and '" + MV_PAR02 + "'" + CRLF
cQuery += " AND RA_MAT between '"+ MV_PAR03 + "' and '" + MV_PAR04 + "'" + CRLF
cQuery += " AND RA_CC between '"+ MV_PAR05 + "' and '" + MV_PAR06 + "'" + CRLF
cQuery += " AND RA_SINDICA between '"+ MV_PAR07 + "' and '" + MV_PAR08 + "'" + CRLF
cQuery += " AND RA_DEMISSA between '"+ DtoS(MV_PAR09) + "' and '" + DtoS(MV_PAR10) + "'" + CRLF
cQuery += " ORDER BY RA_FILIAL, RA_MAT" + CRLF
Por favor Acessar ou Registrar para participar da conversa.
Tempo para a criação da página:0.111 segundos