Welcome to WebmasterWorld Guest from 220.127.116.11
Forum Moderators: open
The Query I have at the moment is
SELECT MONTH(Datecomplete) AS MONTHNO, DATENAME(month,DateComplete) AS MonthComplete, SUM(Price*QTY) AS Total
FROM OrderParts INNER JOIN
Orders ON OrderParts.OrderID = Orders.OrderID
WHERE AND YEAR(DateComplete)=@Year
GROUP BY MONTH(Datecomplete),DATENAME(month,DateComplete)
ORDER BY MONTHNO
Any help would be appriciated
Then use an outer join to include all rows from the month table and a case select rule for any months with no data.
could you give me an example of how to code a union with the month numbers hard coded.
Thanks again for your help