Thiago Queiroz Posted June 26, 2019 Topic Count: 6 Topics Per Day: 0.00 Content Count: 10 Content Per Day: 0.00 Reputation: 0 Achievement Points: 106 Solved Content: 0 Days Won: 0 Status: Offline Age: 34 Report Posted June 26, 2019 Boa tarde, Gostaria de uma ajuda com um relatório que estou montando, no relatório deve ter todos os fornecedores que a empresa DEVE porem não pode ter "puxa" os já pagos, cancelados e com cheque. montei um que a condição é flan.statuslan = '0' que vai puxar os resultados que não foram pagos, porem puxa os vencidos e com cheque, e nao acho nada nas tabelas que eu posssa por outra condição para diferenciar. SELECT FLAN.CODCOLIGADA, FLAN.CODCFO, FCFO.NOME, SUM(FLAN.VALORORIGINAL) AS [VALOR TOTAL] FROM FLAN INNER JOIN FCFO ON ( FLAN.CODCOLCFO = FCFO.CODCOLIGADA AND FLAN.CODCFO = FCFO.CODCFO ) WHERE FLAN.PAGREC = '2' AND FLAN.STATUSLAN = '0' GROUP BY FLAN.CODCOLIGADA,FLAN.CODCFO, FCFO.NOME ORDER BY FLAN.CODCOLIGADA, FCFO.NOME
Jair - Fórmula Posted July 18, 2019 Topic Count: 951 Topics Per Day: 0.13 Content Count: 9,215 Content Per Day: 1.24 Reputation: 466 Achievement Points: 110,001 Solved Content: 0 Days Won: 271 Status: Offline Age: 54 Device: Windows Report Posted July 18, 2019 Você tem que analisar a tabela FLANBAIXA. Até porque podem existir baixas parciais nos seus títulos, onde o valor pendente não é o Valor Original mais.
Thiago Queiroz Posted July 22, 2019 Topic Count: 6 Topics Per Day: 0.00 Content Count: 10 Content Per Day: 0.00 Reputation: 0 Achievement Points: 106 Solved Content: 0 Days Won: 0 Status: Offline Age: 34 Author Report Posted July 22, 2019 fiz a condição com flan.statusextrato, e a principio funcionou. SELECT FLAN.CODCOLIGADA, FLAN.CODCFO, FCFO.NOME, SUM(FLAN.VALORORIGINAL) AS [VALOR TOTAL] FROM FLAN INNER JOIN FCFO ON ( FLAN.CODCOLCFO = FCFO.CODCOLIGADA AND FLAN.CODCFO = FCFO.CODCFO ) WHERE FLAN.PAGREC = '2' AND FLAN.STATUSLAN = '0' AND FLAN.STATUSEXTRATO = '0' GROUP BY FLAN.CODCOLIGADA,FLAN.CODCFO, FCFO.NOME ORDER BY FLAN.CODCOLIGADA, FCFO.NOME
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now