Something like this:

select Month_Name
       case Month_Name
         when 'January' then 1
         when 'February' then 2
         when 'March' then 3
         ... etc ...
       else 13
       end as Month_Order
from Your_Table
where Something = Something
order by Month_Order

Ray Thompson
Tau Beta Pi (www.tbp.org)
The Engineering Honor Society
865-546-4578 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 12, 2007 9:59 AM
To: SQL
Subject: Sort by month

I have a table with the month stored as January, February,
March.....etc. How do I write a query to order by month so that January
is first, Feb second and so on? I'm using SQL server and ColdFusion.







~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 and Flex 2 
Build sales & marketing dashboard RIA’s for your business. Upgrade now
http://www.adobe.com/products/coldfusion/flex2?sdid=RVJT

Archive: http://www.houseoffusion.com/groups/SQL/message.cfm/messageid:2868
Subscription: http://www.houseoffusion.com/groups/SQL/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6

Reply via email to