Use DATEPART Function as a LIKE operator.

Ranjeet_8
Posted by Ranjeet_8 under Sql Server category on | Points: 40 | Views : 1168

SELECT * Your_Table_Name
where (DATEPART(yy, Your_Column_Name) = 2012
AND DATEPART(mm, Your_Column_Name) ) = 10
AND DATEPART(dd, Your_Column_Name) ) = 18)
order by Your_Column_Name desc

Comments or Responses

Login to post response