Wednesday, August 27, 2008

sql server how to order by month,date


Order By Month

SELECT Emp_Name,CONVERT(varchar(11),DOB,113) as DOB FROM CV_DOB order By MONTH(DOB)


Order By Date

SELECT Emp_Name,CONVERT(varchar(11),DOB,113) as DOB FROM CV_DOB order By DAY(DOB)

No comments: