Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. SELECT Count(T1.documento) AS 'apolices_a_renovar',
  2. month(T1.termino_vigencia) as 'mes_vigencia',
  3. year(T1.termino_vigencia) as 'ano_vigencia',
  4. T2.divisao as 'divisao'
  5. from tabela_documentos T1,
  6. tabela_docsrepasses T2
  7. where T1.termino_vigencia between '".$month."/01/".$year."' and '".$month."/31/".$year."'
  8. and T1.alteracao = 0
  9. and T1.situacao <> '2'
  10. and T1.documento = T2.documento
  11. and T1.alteracao = T2.alteracao
  12. and T2.divisao = $idCOL
  13. group by T2.divisao, year(T1.termino_vigencia), month(T1.termino_vigencia)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement