select
cast(year(appointmentdate) as char(4))+''+
case when len(cast(month(appointmentdate)as char(2)))=1
then '0'+cast( month(appointmentdate) as char(2) ) else cast(month(appointmentdate) as char(2))end as apporder
from timeslots
group by appointmentdate
order by appOrder