How to: |
The CAST function converts the value of its argument to a specified data type.
CAST(expression AS data_type[(length)])
where:
Any data type that can be converted to the result data type
Is the value to be converted.
Is the result data type: CHARACTER, CHARACTER VARYING, NUMERIC, DECIMAL, INTEGER, SMALLINT, FLOAT, REAL, DOUBLE PRECISION, DATE, TIME or TIMESTAMP.
Is an optional parameter of character data types.
This function returns the input value converted to the specified data type.
CAST converts a value to a specified data type. This example,
CAST(2.5 AS INTEGER)
returns 2.
This example,
CAST('3.333' AS FLOAT)
returns 3.333.
iWay Software |