Dear Teami'm facing some behavioural issues with the temp tbl in sql 2012 version.qry details are belowselect distinct txtMonth + ' - '+ txtFiscalYear as txtMonthValue,intMonth,intYear,MAX(intTimePKID) as intTimePKID into #tempfrom tblcaldenderwhere dtDate > DATEADD(mm,-12,getdate()) and dtDate <= GETDATE()group by txtMonth + ' - '+ txtFiscalYear,intMonth,intYearorder by intTimePKID descselect txtMonthValue as txtLabel,txtMonthValue as txtValue from #tempdrop table #temp
in 2012 version o/ p as below. its coming up in alphabetical order where as in 2008 version it's coming up correctly as per PKID.could you please help.April - FY15August - FY14August - FY15December - FY14February - FY14January - FY14July - FY15June - FY15March - FY14May - FY15November - FY14October - FY14September - FY14