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'.