Chris90
Chris90

Reputation: 1998

Filtering for Month for timestamp column

I use the Month function like below to filter for a month as:

Where MONTH(timestampcolumn) = '9'

If I want to do same but filter for month based on name like September how would I do that?

Thanks

Upvotes: 0

Views: 463

Answers (1)

Nick
Nick

Reputation: 147166

You can use DATE_FORMAT to convert the timestamp into a month name using the %M format string:

WHERE DATE_FORMAT(timestampcolumn, '%M') = 'September'

Upvotes: 3

Related Questions