Google BigQuery SQL Dates and Times Cheat Sheet
https://towardsdatascience.com/google-bigquery-sql-dates-and-times-cheat-sheet-805b5502c7f0
Photo by Sonja Langford on UnsplashI have just started working on a time series forecasting project this morning. The first step in this project, as with most data science tasks, was to gather the data first. This meant a relatively simple SQL query in Google BigQuery. Once again I found myself googling how to extract the year from a timestamp, and scrolling through the documentation to find the correct function and realised that I needed to write this down somewhere. I am writing this into a blog post so that I have something to refer back to, and hopefully this may also help others. Please note all expressions are based on Standard SQL.
List of all date parts that can be used in the expressions listed below: