Click here to Skip to main content
15,885,164 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i would like to sort month from table according to calendar wise can anyone help
but the column is varchar format not datetime
like

January
February
March
.
.
.
.
.
Posted
Updated 31-May-12 21:35pm
v3
Comments
nagendrathecoder 1-Jun-12 2:55am    
Not clear, please explain more.
Prasad_Kulkarni 1-Jun-12 2:57am    
Hey nag, nice to see you here..you are more quicker,
nagendrathecoder 1-Jun-12 3:00am    
same here. more quicker mhanje?
Prasad_Kulkarni 1-Jun-12 3:10am    
are quick comment post kelis na mhnun mhnalo ;)
nagendrathecoder 1-Jun-12 3:32am    
Oh achcha hehe

Try:
SQL
SELECT * FROM MyTable WHERE DATEPART(month, myDateColumn)=5
 
Share this answer
 
First select your column and write a case that if it is jan set 1,feb-2.... Then according to that key value you can sort.
I don't know confirmly whether it will work out.
 
Share this answer
 
Hi Anand,

I've answered this here:

how to sort month by calander wise[^]

Happy Coding :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900