I'm running a query in a vb.net project
SELECT DATENAME(Month, DTE) AS mydate, SUM(amount) AS Tamt
FROM Checks
GROUP BY DATENAME(Month, DTE)
Getting the results as:
February 5913.3600
January 20096.1200
March 3561.6300
I want to order them by month (January, February, march etc.). I've tried order by DATEPART(Month, DTE) and then Month(DTE)
SELECT DATENAME(Month, DTE) AS mydate, SUM(amount) AS Tamt, DATEPART(Month, DTE) AS Expr1
FROM Checks
GROUP BY DATENAME(Month, DTE)
ORDER BY Expr1
with no luck Just keep getting
the standard can only contain aggregate function error.
Thanks
SELECT DATENAME(Month, DTE) AS mydate, SUM(amount) AS Tamt
FROM Checks
GROUP BY DATENAME(Month, DTE)
Getting the results as:
February 5913.3600
January 20096.1200
March 3561.6300
I want to order them by month (January, February, march etc.). I've tried order by DATEPART(Month, DTE) and then Month(DTE)
SELECT DATENAME(Month, DTE) AS mydate, SUM(amount) AS Tamt, DATEPART(Month, DTE) AS Expr1
FROM Checks
GROUP BY DATENAME(Month, DTE)
ORDER BY Expr1
with no luck Just keep getting
the standard can only contain aggregate function error.
Thanks