In BigQuery, If you want get first day from a Date (or timestamp, datetime type) , for example, type “2017-05-24” and get “2017-05-01”, you can call UTC_USEC_TO_MONTH function in Legacy SQL, or DATE_TRUNC() in Standard SQL, In fact, BigQuery have a series function do these thing, Get First day, hour, week…..etc from a Date.
閱讀全文 BigQuery SQL Get First or Last Day of Month From Specify Date