MS SQL select a datetime by month?
SELECT *
FROM TABLE A
WHERE DATEPART(month, MY_DATETIME) = 8
Or, less reliably based on language setting:
...
WHERE DATENAME(month, MY_DATETIME) = 'August'
I use EXTRACT
function instead of DATEPART
.
DATEPART
function doesn't exist in my mysql.