>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.
I would suggest creating a temp table with an ID and the month from the original table and a new column called monthID. Then do a mass update on that temp table that updates the monthID in the temp table based on your query. UPDATE TempTable SET MonthID = 1 WHERE Month = January UPDATE TempTable SET MonthID = 2 WHERE Month = February and so on⦠Once you have the temp table with the monthID in it just write a query that joins on the temp table and order by monthID. I hope that helps. If you want a little more help with the actual query let me know. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion 8 beta â Build next generation applications today. Free beta download on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/SQL/message.cfm/messageid:2865 Subscription: http://www.houseoffusion.com/groups/SQL/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.6
