Sample Sql By Month By Date By Amount


Sample Sql By Month By Date By Amount
SELECT
YEAR(date) AS [Year],
MONTH(date) AS [Month],
DATENAME(MONTH, date) AS [Month Name],
sum(amount) AS [Sales Amount]
FROM dbo.DailySales
GROUP BY YEAR(date), MONTH(date), DATENAME(MONTH, date)
ORDER BY YEAR(date), MONTH(date)

Related posts:

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *