---
cuppy_hub: salesforce
cuppy_path: reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/extract.md
cuppy_section: docs
cuppy_doc: C9B7-DQF5
cuppy_doc_uuid: 1cb68c52-5e92-4b6f-acfb-601d55825f56
cuppy_permalink: https://cuppy.io/salesforce/d/C9B7-DQF5
cuppy_version: 1
cuppy_updated: 2026-10-23T16:16:52.575Z
cuppy_canonical: https://cuppy.io/salesforce/docs/reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/extract
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: f118e2f201f6f2ce76169c91b8c903a5c2008afd1fd9fb58a5fad7461e695611
# cuppy_body_sha256 is over the document body ALONE, excluding both generated blocks.
---

> Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/extract.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.

## `EXTRACT` and `DATE_PART`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Retrieves a subfield, such as the year or hour, from a date, time, timestamp, or interval value. `EXTRACT` and `date_part` are equivalent. Use `EXTRACT` for computational processing. To display date or time values as formatted text, see [Formatting Functions](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/formatting-func.html).

*   `<field>`: An identifier or string that selects the field to extract from the source value. `EXTRACT` and `date_part` support the same field options. For valid options, see [Fields](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/extract.html#fields).
*   `<source>`: The value to extract the field from. Must be an expression of type `date`, `timestamp`, `timestamptz`, `time`, or `interval`. These functions cast values of type `date` to `timestamp`.

*   `<fiscal_option>`: A fiscal calendar option that defines the start date of the fiscal calendar. `<source>` must be of type `date`, `timestamp`, or `timestamptz`, and `<field>` must be `fiscal_week`, `fiscal_month`, `fiscal_quarter`, or `fiscal_year`. See [Fiscal Calendar Options](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/fiscal-calendar-options.html).
*   `<localized_week_option>`: A localized week option that defines the start of a week and a year. `<source>` must be of type `date`, `timestamp`, or `timestamptz`, and `<field>` must be `localized_week`. See [Localized Week Options](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/localized-week-options.html).

The result type of `EXTRACT` depends on the field:

*   `numeric(8,6)` for the field `second`
*   `numeric(18,6)` for the field `epoch`
*   `integer` for any other field

The result type of `date_part` is always `double precision`, independent of the selected field.

`century`
The century. The first century starts at 0001-01-01 00:00:00 AD. There's no century number 0.

`day`
For `timestamp` values, the day of the month (1–31). For `interval` values, the number of days.

`decade`
The year field divided by 10.

`dow`
The day of the week as Sunday (`0`) to Saturday (`6`).

`doy`
The day of the year (1–365/366).

`epoch`
For `timestamp with time zone` values, the number of seconds since 1970-01-01 00:00:00 UTC (can be negative). For `date` and `timestamp` values, the number of seconds since 1970-01-01 00:00:00 local time. For `interval` values, the total number of seconds in the interval.

To convert an epoch value back to a timestamp, use [`to_timestamp`](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/to-timestamp.html).

`fiscal_month`
The month within the fiscal year (1–12).

`fiscal_quarter`
The quarter within the fiscal year (1–4).

`fiscal_week`
The week within the fiscal year (1–54).

`fiscal_year`
The fiscal year.

`hour`
The hour field (0–23).

`isodow`
The day of the week as Monday (`1`) to Sunday (`7`). This is identical to `dow` except for Sunday.

`isoyear`
The ISO 8601 week-numbering year that the date falls in (not applicable to intervals). Each ISO 8601 week-numbering year begins with the Monday of the week containing January 4. In early January or late December, the ISO year can differ from the Gregorian year. See the `week` field for more information.

`localized_week`
The week within the year with a custom start date, determined by the `first_day_of_localized_week` and `minimal_days_in_localized_first_week` parameters. See [Localized Week Options](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/localized-week-options.html) for a detailed explanation and examples.

`microseconds`
The seconds field, including fractional parts, multiplied by 1,000,000.

`millennium`
The millennium. Years in the 1900s are in the second millennium. The third millennium started January 1, 2001.

`milliseconds`
The seconds field, including fractional parts, multiplied by 1000.

`minute`
The minutes field (0–59).

`month`
For `timestamp` values, the number of the month within the year (1–12). For `interval` values, the number of months, modulo 12 (0–11).

`quarter`
The quarter of the year (1–4) that the date is in.

`second`
The seconds field, including fractional parts (0–59; can be 60 on leap seconds).

`timezone`
The time zone offset from UTC, measured in seconds. Positive values correspond to time zones east of UTC, and negative values correspond to zones west of UTC.

`timezone_hour`
The hour part of the time zone offset.

`timezone_minute`
The minute part of the time zone offset.

`week`
The number of the ISO 8601 week-numbering week of the year. ISO weeks start on Mondays, and the first week of a year contains January 4 of that year. For example, the first Thursday of a year is in week 1 of that year. In the ISO week-numbering system, early January dates can fall in the 52nd or 53rd week of the previous year, and late December dates can fall in the first week of the next year. For example, `2005-01-01` is part of the 53rd week of 2004, `2006-01-01` is part of the 52nd week of 2005, and `2012-12-31` is part of the first week of 2013. Use the `isoyear` field together with `week` to get consistent results.

`year`
The year field. There's no `0 AD`, so subtract `BC` years from `AD` years with care.

*   [DATE_TRUNC](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/date-trunc.html)
*   [Fiscal Calendar Options](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/fiscal-calendar-options.html)
*   [Localized Week Options](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/localized-week-options.html)
*   [Formatting Functions](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/formatting-func.html)
*   [Date/Time Functions and Operators](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/datetime-func.html)


---
<!-- cuppy -->
You are reading one file. The same content is free over MCP at https://cuppy.io/mcp with no signup: ranked search across all 376 documents in this hub, the merged view when you work in a layer, known workarounds matched to the error you hit, and depth control so you spend tokens on what you need. Start with the `_hello` tool. How to connect: https://cuppy.io/salesforce/ Something wrong in this document? Report it with the `session feedback` tool on the same endpoint.
<!-- /cuppy -->
