Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT Count(T1.documento) AS 'apolices_a_renovar',
- month(T1.termino_vigencia) as 'mes_vigencia',
- year(T1.termino_vigencia) as 'ano_vigencia',
- T2.divisao as 'divisao'
- from tabela_documentos T1,
- tabela_docsrepasses T2
- where T1.termino_vigencia between '".$month."/01/".$year."' and '".$month."/31/".$year."'
- and T1.alteracao = 0
- and T1.situacao <> '2'
- and T1.documento = T2.documento
- and T1.alteracao = T2.alteracao
- and T2.divisao = $idCOL
- group by T2.divisao, year(T1.termino_vigencia), month(T1.termino_vigencia)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement