Data Type Formatting Functions

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

markdownreferencev1QVEY-HDATguide: data-cloud-query-guidestage: referencetrust: officialsource: developer.salesforce.comservice: data360interface: sqlData Type Formatting FunctionsData 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/formatting-func.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.

Data Type Formatting Functions

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Functions that convert between numbers, dates, and timestamps and their string representations. Use data type formatting functions to:

  • Format numbers for display by converting numeric values to strings with custom patterns.
  • Parse date and time strings by converting text input into typed date or timestamp values.
  • Generate readable output by formatting timestamps and intervals into locale-friendly strings.
  • NULL handling: All formatting functions return NULL when any argument is NULL.
  • Pattern syntax: Date and time formatting uses TO_CHAR patterns (such as YYYY-MM-DD). Numeric formatting uses FORMAT_NUMBER patterns (such as #,###.0).

Convert typed values to formatted strings:

  • FORMAT_NUMBER — Convert a number to a string using a format pattern.
  • TO_CHAR — Convert a timestamp or interval to a string using a format pattern.

Convert strings to typed date and time values:

  • TO_DATE — Convert a string to a date using a format pattern.
  • TO_TIMESTAMP — Convert a string to a timestamp using a format pattern.

Convert a numeric value to a string with thousands separators and decimal places.

Returns '1,234,567.89'.

Convert a text date into a typed date value for comparison or arithmetic.

Returns 2000-12-05.

Convert the current timestamp into a human-readable string.

Returns a string such as 'Tuesday, 6 May 2025 03:22:45 PM'.

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