Extract Month and Year from date in Bigquery

You can just use the FORMAT_DATETIME function:

\n\n
SELECT\n    FORMAT_DATETIME("%B, %Y", DATETIME "2018-05-09 15:30:00")\nFROM yourTable;\n
\n\n

This should print May, 2018.

Ryan-Dallas

posted on

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds