Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with Addmonths

Hi folks, i´m having a problem with ADDMONTHS in a table graph.

I´have a simple structura like that:

[Codigos]:

CODIGO (INTEGER),

DT_COMPETENCIA_INICIAL (DATE);

CODIGOS.jpg

[Periodos]:

CODIGO (INTEGER),

DT_COMPETENCIA_ATUAL (DATE),

FL_ATIVO {S,N}

periodos.jpg

At column(1), i need count CODIGO that have DT_COMPETENCIA_ATUAL = DT_COMPETENCIA_INICIAL + 30

At column(2), i need count CODIGO that have DT_COMPETENCIA_ATUAL = DT_COMPETENCIA_INICIAL + 60

And so on...

tabela.jpg

Thank you so much,

1 Reply
Gysbert_Wassenaar