Quantcast
Channel: SQLServerCentral » SQL Server 2014 » Development - SQL Server 2014 » Latest topics
Viewing all articles
Browse latest Browse all 3145

rolling 12 months

$
0
0
have a condition ' where year = 2015' now i want change rolling to 12 months i am adding something like this "year =dateadd(mm,datediff(mm,0,getdate())-12,0)" which is not working i guess i am not doing properly I need some help here!!If i dont have the Year condition i am getting rows from 2015 and 2016 Exp of data as follows:Month Yearmm releaseJan 201401 1Feb 201402 2so on....Jan 201501 1Feb 201502 2Mar 201503 1so on....Jan 201601 1

Viewing all articles
Browse latest Browse all 3145

Trending Articles