How to get Day name in Google BigQuery

In Google's Big Query, the function to use is: format_datetime('%A',yourdate) instead of format_date as posted in 2017.


Yes, there are equivalent functions in both, standardSQL and legacySQL.

Standard SQL

You can use the FORMAT_DATE() function where you can use any date format you'd like. Link to Docs

Example:

#standardSQL
SELECT
  CURRENT_DATE() AS date,
  FORMAT_DATE('%A', CURRENT_DATE()) AS dow

Legacy SQL

There is the STRFTIME_UTC_USEC() function. It requires converting your timestamp to USEC first though. Link to docs

Example:

#legacySQL
SELECT
  CURRENT_DATE() AS date,
  STRFTIME_UTC_USEC(TIMESTAMP_TO_USEC(TIMESTAMP(CURRENT_DATE())), '%A') AS dow