I have the following select:
SELECT * FROM Table
WHERE Column= datepart(month,'2013-05-07 10:18:00')
AND Column= datepart(year,'2013-05-07 10:18:00')
I want it to show me itens where month= 05 and year= 2013. Actually it isn't showing anything (but there is results to be show). Thanks.
I would use the MONTH and YEAR functions
SELECT * FROM Table
WHERE MONTH(yourColumn) = 5 and YEAR(yourColumn) = 2013