`DATE_TRUNC`

Data 360 Query Guide, mirrored from developer.salesforce.com: **Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

markdownreferencev14F7A-BP7Cguide: data-cloud-query-guidestage: referencetrust: officialsource: developer.salesforce.comservice: data360interface: sql`DATE_TRUNC`Data 360Data CloudData 360 Query Guide

Created 23 Oct 2026 · Modified 23 Oct 2026 · 1 version

Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/date-trunc.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.

DATE_TRUNC

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Truncates a timestamp, timestamptz, or interval to a specified precision, such as hour, day, or month.

  • <field>: The precision to truncate to. Sets all lower-order fields to zero, or to one for day and month.

Valid values: microseconds, milliseconds, second, minute, hour, day, week, localized_week, fiscal_week, month, fiscal_month, quarter, fiscal_quarter, year, fiscal_year, decade, century, and millennium.

  • <source>: The value to truncate.

Valid values: timestamp, timestamptz, or interval. DATE_TRUNC casts values of type date and time to timestamp or interval, respectively.

  • <time_zone>: The time zone to truncate with respect to. Applies only to timestamptz input. By default, DATE_TRUNC uses the current time zone.
  • <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.
  • first_day_of_localized_week => <value>: A localized week option that defines the start of a week. <source> must be of type date, timestamp, or timestamptz, and <field> must be localized_week. See Localized Week Options.

Returns a timestamp, timestamptz, or interval value that matches the type of the source.

  • <source> can’t be of type interval when <field> is week, because a month can contain a fractional number of weeks.
  • You can’t provide a time zone with timestamp or interval input.
  • With timestamptz input, DATE_TRUNC truncates with respect to a time zone. For example, truncating to day produces the value that is midnight in that zone.

These examples assume the local time zone is America/New_York.

Returns 2001-02-16 20:00:00.

Returns 2001-01-01 00:00:00.

Returns 3 days 02:00:00.

Returns 2001-02-16 00:00:00-05.

Returns 2001-02-01 00:00:00.

Read this document as markdown — the same bytes an agent receives.