10 June 2019 · Ryan-Dallas ·       Add to Favorites   Report

Extract Month & Year from date in Bigquery

You can just use the FORMAT_DATETIME function:

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

This should print May, 2018.

Ryan-Dallas

posted on 10 June 2019

Read great educational content like this and a lot more !

Members get free exclusive access to content, new courses, and discounts. Signup for a free account to write a post / comment / upvote posts. Creating an account takes less than 5 seconds and you can start earning badges & points too

Copied