childrenfirst
Technical User
Hi,
This is probably too easy for experts in this forum, but I just can't figure it out by myself...
I have a query like this:
SELCTE DATENAME(dw,[Date]),COUNT(*)
FROM Dates, TimeOff
WHERE DATENAME(dw,[DATE]) BETWEEN StartDate AND EndDate
GROUP BY DATENAME(dw,[Date])
It returns results like this:
Friday 1
Saturday 1
Tuesday 3
Wednesday 2
But I would like to sort the results by day of week instead of alphabetically.
I tried to add ORDER BY DATENAME(dw,[DATE]) at the end of the query but it did not work.
Any advice will be greatly appreciated!
This is probably too easy for experts in this forum, but I just can't figure it out by myself...
I have a query like this:
SELCTE DATENAME(dw,[Date]),COUNT(*)
FROM Dates, TimeOff
WHERE DATENAME(dw,[DATE]) BETWEEN StartDate AND EndDate
GROUP BY DATENAME(dw,[Date])
It returns results like this:
Friday 1
Saturday 1
Tuesday 3
Wednesday 2
But I would like to sort the results by day of week instead of alphabetically.
I tried to add ORDER BY DATENAME(dw,[DATE]) at the end of the query but it did not work.
Any advice will be greatly appreciated!