Reply to Re: Year, Month, Count on an Invoices Table
Posted by Plamen Ratchev on 03/04/07 03:08
It is not very clear what is the format of your table, but assuming you have
table Invoices with column OrderDate (datetime data type), something like
this should give you what you need:
SELECT Year(OrderDate) AS OrderYear,
Month(OrderDate) AS OrderMonth,
Count(*) AS OrdersCount
FROM Invoices
GROUP BY Year(OrderDate), Month(OrderDate)