Hi,
I have a query in SQL Server 2014
select month((CDate)) as CreateMonth, year((CDate)) as CreateYear, count(*) "No of Users"
from kf, dt
where kf.type=0 and kf.ID=dt.ID
group by month(CDate), year(CDate)
order by year(CDate) desc, month(CDate) desc
It display results as below:
CreateMonth CreateYear No of Users
------------------- ---------------- -----------------
10 2018 7
9 2018 9
8 2018 6
7 2018 3
Now I want to have results as below:
CreateMonthYear No of Users
-------------------------- -----------------
Oct 2018 6
Sep 2018 16
Aug 2018 3
July 2018 20
So
1. Converting Month from numeric to three character Alphabets
2. Merging year together with month
3. Date column should be sorted DESC