4.8/5
Home

Integrations

Plug Count neatly into your existing data infrastructure

For data teams

Collaborative, AI-driven data exploration and modelling

For product & growth

Faster access to the answers which matter

For leaders

Turning data into an engine of improvement

Pricing

Latest post

Meet the new Count Agent

Meet the new Count Agent

Docs

Guides, references, and API docs

Blog

Opinions, analysis, and the occasional uncomfortable truth about data.

Webinars

Join our experts for deep dives into data analytics and business intelligence

Gallery

Browse ready-to-use canvas templates and try them instantly

Sign in

Where to begin?

Start for free

Spin up a canvas and explore your data — a couple of clicks, no card.

Book a demo

See it live. Bring your questions — we’ll bring the answers.

Still not sure?

Send us a note — we’ll point you the right way.

Data to decisions, faster.

Compare

  • Count vs BI
  • Count vs Notebooks
  • Count vs Chatbots
  • Count vs Hex
  • Count vs Looker
  • Count vs Tableau
  • Count vs Thoughtspot

Learn

  • Blog
  • Webinars
  • SQL tutorials

Legal & security

  • Privacy Policy
  • Terms of Use
  • Cookies Policy
  • Trust Center
  • Security

Social

  • LinkedIn →
  • YouTube →
  • X →

Start with the hard question.

Ask Count anything — we’ll take you straight into a canvas.

Opens sign-up with your prompt ready for Count.

© 2026 Count Technologies Ltd. All rights reserved.

Careers →Book a Demo →
count

SQL Resources

Count is the best SQL IDE, wrapped up in the best data analysis tool, all inside the best BI platform.

ARRAY_AGG
Arrays Explained
Arrays Explained
CASE
CAST
COALESCE
CONCAT
COUNT [DISTINCT]
CURRENT_DATE
CURRENT_DATETIME
CURRENT_TIMESTAMP
DATETIME_DIFF
DATETIME_TRUNC
DATE_DIFF
DATE_TRUNC
Data Types
Dates and Times
EXTRACT
DefinitionRelated Pages
IF
MEDIAN
SUBSTR
String Functions Explained
TIMESTAMP_DIFF
TIMESTAMP_TRUNC
TIME_DIFF
TIME_TRUNC
UNNEST
Window Functions Explained
SQL Resources/BigQuery Standard SQL/EXTRACT

EXTRACT

EXTRACT function. Definition, syntax, examples and common errors using BigQuery Standard SQL. The EXTRACT function returns the number of rows in a SQL expression.

Definition

The EXTRACT function in BigQuery will return a specific part of a DATE, DATETIME or TIMESTAMP.

Where expression is a DATE, part values can be:

EXTRACT(part FROM expression)
  • DAYOFWEEK Returns a number 1-7 with Sunday being the first day of the week.
  • WEEK() WEEKDAY defines the start of the week, values can be SUNDAY, MONDAY etc

Returns: INT64

Where expression is a DATETIME, part values can be all of the parts used with DATE (as listed above) plus:

WITH table AS (
  SELECT DATETIME(TIMESTAMP '2021-01-05 00:00:00+00', 'UTC') AS datetime
)
SELECT
  datetime,
  EXTRACT(WEEK FROM datetime) AS week_sunday,
  EXTRACT(WEEK(MONDAY) FROM datetime) AS week_monday
FROM table
  • MICROSECOND
  • MILLISECOND

Returns: DATE for DATE part and TIME for TIME part.

Where expression is a TIMESTAMP, part values can be all of the parts used with DATE and DATETIME (as listed above) plus:

WITH table AS (
  SELECT
    CAST('2021-01-05 00:00:00+00' AS TIMESTAMP) AS datetime
)
SELECT
  datetime,
  EXTRACT(HOUR FROM datetime AT TIME ZONE 'America/Los_Angeles') AS hour_in_LA,
  EXTRACT(HOUR FROM datetime) AS hour
FROM
  table

Returns: DATETIME for DATETIME part.

datetimeweek_sundayweek_monday
2021-01-05T00:00:0011

When expression is a TIMESTAMP you an add an optional argument to specify the timezone of the output:

datetimehour_in_LAhour
2021-01-05T00:00:00.000Z160

Related Pages

  • Dates and Times in BigQuery

Got a CSV?
See it differently in <2 mins

Get started for FREEWatch our CEO do it