XploreDotNet
Known Is A Drop,UnKnown Is An Ocean....
Njoy Programming
Saturday, May 16, 2015
Sql Server order by month name
Following Script will order the result in actual calendar month order.
SELECT
*
FROM
[dbo]
.
[tablename]
ORDER
BY
DATEPART
(
mm
,
CAST
(
[DateFieldColumnName]
+
' 1900'
AS
DATETIME
))
ASC
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
Loading...
No comments:
Post a Comment