October 2, 2011

Sql Convert Month Name to Number

Below is sql code to convert Month Name to Number ex.
January to 1


DATEPART(mm,CAST('MonthName'+ ' 1900' AS DATETIME))

No comments:

Post a Comment