Hi
I have an issue in below stored procedure.
below Store procedure is working fine. But fixed the Year.
Any one know How can do the year dynamically select by user?
SELECT * FROM ( SELECT salesEXE,SalesEXEName,name,gross,YearNo FROM vw_Pivot_Month_ALL) TableYearNo
pivot (Sum(gross) for [yearno] in ([2008],[2009],[2010],[2011],[2012],[2013],[2014],[2015],[2016],[2017],[2018],[2019],[2020])
)pivotTable
pls advice
Maideen