Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

order by monthly in sql

SELECT     { fn MONTHNAME(OrderDate) } AS MonthName, YEAR(OrderDate) AS Year, SUM(TotalValue) AS Profits
FROM         [Order]
WHERE     (YEAR(OrderDate) = @year)
GROUP BY { fn MONTHNAME(OrderDate) }, MONTH(OrderDate), YEAR(OrderDate)
order by Year(orderDate),month(OrderDate)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #order #monthly #sql
ADD COMMENT
Topic
Name
6+6 =