Link to home
Start Free TrialLog in
Avatar of varesources
varesourcesFlag for Afghanistan

asked on

How do I make this query order by month: January, February, March....?

With the current query it orders the months alphabeticaly. How do I make it order correctly?
SELECT

  DATENAME(mm,FilteredNew_application.new_effectivestartdate) as Month
  ,sum(FilteredNew_application.new_gp) as GP
  ,sum(FilteredNew_application.new_approvalamount) as Approval
  ,sum(FilteredNew_application.new_equiptmentcost) as Revenue
  
FROM
  FilteredNew_application
WHERE
  FilteredNew_application.new_primaryvendoridname LIKE N'Dell%'
  AND FilteredNew_application.new_applicationstatusname = N'Vendors Paid'
AND FilteredNew_application.new_effectivestartdate >= N'02/01/2010 00:00:00'

Group by DATENAME(mm,FilteredNew_application.new_effectivestartdate)
Order by DATENAME(mm,FilteredNew_application.new_effectivestartdate)

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of cyberkiwi
cyberkiwi
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of varesources

ASKER

Thank you!