Converts expression from its original format into the chosen format.
Syntax:
CAST( expression as DataType )
Data Types:
- BIT
- CHAR
- VARCHAR
- NVARCHAR
- NCHAR
- TEXT
- NTEXT
- DATE
- DATETIME
- DECIMAL
- DOUBLE
- FLOAT
- INTEGER
- VARCHAR
- REAL
- SMALLINT
- TINYINT
See also: SAFECAST.
Example:
CAST(Expression AS TEXT)
CAST(Expression AS DATETIME)
CAST(Expression AS BIT)
CAST(Expression AS TINYINT)
CAST(Expression AS SMALLINT)
CAST(Expression AS INTEGER)
CAST(Expression AS BIGINT)
CAST(Expression AS REAL)
CAST(Expression AS DOUBLE)
CAST(Expression AS DECIMAL)
Comments
Please sign in to leave a comment.