Show name of day in case of day number in T-SQL
Posted on 2011-05-05
I use the following command to create a dataset containing two columns. The first column shows the number of the day in the week and the second column shows the numbers of orders on a certain week day. The result is something like this:
1 50 (meaning 50 orders on sundays)
2 32 (32 orders on mondays)
This is nice but I would like a like to show the name of the days in case of their numbers.
So the result should be:
My SQL command:
SELECT DATEPART (WEEKDAY, Bon_DtmBestelbon), COUNT(*)
GROUP BY DATEPART(WEEKDAY, Bon_DtmBestelbon), Bon_Vrt_Id
How do I edit my command to get the wanted result???