How to get halfyearly data from monthly data
the structure isl ike below
I am having monthwise data i should convert it into halfyeardata with sum values''
Please tell me if anyone knows
DS100 2018-01-01 100
DS101 2018-02-01 100
DS100 2018-07-01 100
DS100 2018-02-01 100
I need like below result
DS100 Halfyear1 200 2018
DS100 Halfyear2 100 2018
DS101 Halfyear1 100 2018
Hi ,
i got answer myselg,please have a look
select DSID,Sum(IntValue),(datepart(mm,MONTH)-1)/6+1 as [halfyearly],datepart(yy,MONTH) as [year] from MonthlyData group by DSID,datepart(yy,MONTH),(datepart(mm,MONTH)-1)/6+1

Sasi RekhaRank #1,362 · 1.2K reputationPosted May 23, 2018, 11:30 PM EDT
Manish KumarRank #1,622 · 956 reputationPosted May 24, 2018, 1:14 AM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted May 24, 2018, 3:59 AM EDT
Sasi RekhaRank #1,362 · 1.2K reputationPosted May 24, 2018, 3:28 AM EDT
Shahriar NikkhahRank #248 · 10.1K reputationPosted May 24, 2018, 4:44 PM EDT
Sasi RekhaRank #1,362 · 1.2K reputationPosted May 24, 2018, 6:04 PM EDT