Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. SELECT sum(CTB_LANCAMENTO_DIVIDIDO.VAL_DIVISAO) VALOR_DIVISAO
  2. FROM
  3. (CNP.CTB_LANCAMENTO CTB_LANCAMENTO
  4. INNER JOIN
  5. CNP.CTB_LANCAMENTO_DIVIDIDO CTB_LANCAMENTO_DIVIDIDO
  6. ON ((CTB_LANCAMENTO.EMPRESA=CTB_LANCAMENTO_DIVIDIDO.EMPRESA)
  7. AND (CTB_LANCAMENTO.ANO_MES=CTB_LANCAMENTO_DIVIDIDO.ANO_MES))
  8. AND (CTB_LANCAMENTO.LANCAMENTO=CTB_LANCAMENTO_DIVIDIDO.LANCAMENTO))
  9. INNER JOIN CNP.CTB_CONTA CTB_CONTA ON (CTB_LANCAMENTO.EMPRESA=CTB_CONTA.EMPRESA)
  10. AND (CTB_LANCAMENTO.CONTA=CTB_CONTA.CONTA)
  11.  
  12. WHERE (CTB_LANCAMENTO.ANO_MES=201903)
  13. AND CTB_LANCAMENTO.CONTA = '31101003'
  14.  
  15. AND CTB_LANCAMENTO.EMPRESA = 2
  16.  
  17. AND CTB_LANCAMENTO_DIVIDIDO.REVENDA_DIVISAO = 2
  18.  
  19. AND CTB_LANCAMENTO_DIVIDIDO.tipo_item = 'P'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement