CHR

Applies to: ✅ Data 360 SQL ✅ Tableau Hyper API

Returns the character corresponding to a given numeric code.

Syntax

chr(<code>)

Arguments

Required

  • <code>: The ASCII code or Unicode code point.

Returns

Returns a single character corresponding to the given code.

Considerations

  • For UTF-8, the function treats the argument as a Unicode code point.
  • The NULL (0) character isn’t allowed because text data types can’t store NULL bytes.

Examples

Convert Code to Character

Get the character for an ASCII code.

SELECT chr(65) AS result;

Returns 'A'.

Related Documentation