Scalar functions

Conversion functions

Function NameDescription
tobool()Converts input to boolean (signed 8-bit) representation.
todatetime()Converts input to datetime scalar.
todouble(), toreal()]Converts the input to a value of type real. (todouble() and toreal() are synonyms.)
tostring()Converts input to a string representation.
totimespan()Converts input to timespan scalar.
tohex()Converts input to a hexadecimal string.
tolong()Converts input to long (signed 64-bit) number representation.

tobool()

Converts input to boolean (signed 8-bit) representation.

Arguments

  • Expr: Expression that will be converted to boolean.

Returns

  • If conversion is successful, result will be a boolean. If conversion isn't successful, result will be false

Example

tobool(Expr)toboolean(Expr) (alias)

todatetime()

Converts input to datetime scalar.

Arguments

  • Expr: Expression that will be converted to datetime.

Returns

If the conversion is successful, the result will be a datetime value. Else, the result will be false.

Example

todatetime(Expr)

todouble(), toreal()

Converts the input to a value of type real. (todouble() is an alternative word to toreal())

Arguments

  • Expr: An expression whose value will be converted to a value of type real.

Returns

If conversion is successful, the result is a value of type real. If conversion is not successful, the result returns false.

Example

toreal(Expr)todouble(Expr)

tostring()

Converts input to a string representation.

Arguments

  • Expr: Expression that will be converted to string.

Returns

(confirm this)

Example

tostring(Expr)

totimespan

Converts input to timespan scalar.

Arguments

  • Expr: Expression that will be converted to timespan.

Returns

If conversion is successful, result will be a timespan value. Else, result will be false.

Example

totimespan(Expr)

tohex()

Converts input to a hexadecimal string.

Arguments

  • Expr: int or long value that will be converted to a hex string. Other types are not supported.

Returns

If conversion is successful, result will be a string value. If conversion is not successful, result will be false.

Example

tohex(value)

tolong()

Converts input to long (signed 64-bit) number representation.

Arguments

  • Expr: Expression that will be converted to long.

Returns

If conversion is successful, result will be a long number. If conversion is not successful, result will be false.

Example

tolong(Expr)