这是需要得到的表格,可选择年月日报表,选择时间段,得到值,还有对应时间的占比,环比,同期比这是数据集select ${p11},sum (ElectricValue) as 'Value'from dbo.RES_Energydata_copy1where 1=1${if(p11='Hour',"and RES_Energydata_copy1.= '"+ date +"' and RES_Energydata_copy1. >= '"+ 开始时间 + "'and RES_Energydata_copy1. <= '"+ 结束时间 +"'","")}${if(p11='day',"and RES_Energydata_copy1. >= '"+ 开始日期d + "'and RES_Energydata_copy1. <= '"+ 结束日期d +"'","")}${if(p11='month',"and RES_Energydata_copy1. >= '"+开始日期m +"' and RES_Energydata_copy1. <='"+ 结束日期m +"'","")}${if(p11='year',"and RES_Energydata_copy1. >= '"+ Y1 +"' and RES_Energydata_copy1. <='"+ Y2 +"'","")}group by ${p11}order by ${p11}p11的值为year,day,month,hour,对应“时间列的值如下”请问这种情况下我要怎么做才能得到同期比呢