Instead you can use the
DATEPART[
^] function to extract portions of dates. Try like this:
SELECT * FROM TableName where DATEPART(yy, YourDateColumn) = 1996
SELECT * FROM TableName where DATEPART(mm, YourDateColumn) = 4
SELECT * FROM TableName where DATEPART(dd, YourDateColumn) = 4
SELECT * FROM TableName where (DATEPART(yy, YourDateColumn) = 1996 AND DATEPART(mm, YourDateColumn) = 4 AND DATEPART(dd, YourDateColumn) = 4)
Like operator will not work with DateTime. Please see
this[
^].
--Amit