ToHex

The ToHex() function converts a text or number to its hexadecimal equivalent.

This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.

Returns a hexadecimal value that is the equivalent of the provided text input or (integer) numeric input. For numeric values, decimals will be ignored - only the integer part of the value will be used for conversion.

Syntax

ToHex(text)

ToHex("qwertyuiop1234567890") =>"71776572747975696f7031323334353637383930"

ToHex(number)

ToHex(255) =>"FF"

ToHex(255.2) =>"FF"

ToHex(255.7) =>"FF"

Parameters

NameTypeRequiredDescription

text

text

Original text to be converted to hexadecimal.

number

numeric

Numeric value to be converted to hexadecimal. Only the integer part of a number will be used, any decimals will be ignored.

Last updated