# How to use cast statement in SQL?

How to Use the SQL CAST Function. Use the SQL CAST function by writing CAST(expression AS target_data_type) . The expression is what you want to convert, and target_data_type is the new type you want the result to have.

Bron: [SQL CAST() Function: Syntax, Usage, and Examples - Mimo](https://mimo.org/glossary/sql/cast-function#:~:text=How%20to%20Use%20the%20SQL,want%20the%20result%20to%20have.)

Onderwerp: [Techniek & internet](https://1001vragen.nl/onderwerp/techniek-en-internet)
Toegevoegd: 2026-01-26
Webpagina: https://1001vragen.nl/vraag/how-to-use-cast-statement-in-sql

## How to use CAST in SQL query?

Use the SQL CAST function by writing CAST(expression AS target_data_type) . The expression is what you want to convert, and target_data_type is the new type you want the result to have.

Bron: [SQL CAST() Function: Syntax, Usage, and Examples - Mimo](https://mimo.org/glossary/sql/cast-function#:~:text=Use%20the%20SQL%20CAST%20function%20by%20writing%20CAST(expression%20AS,want%20the%20result%20to%20have.)

## Why using CAST in SQL?

The SQL CAST function converts the data type of an expression to the specified data type. For a list of the data types supported by InterSystems SQL, see Data Types. CAST is similar to CONVERT, with these differences: CONVERT is more flexible than CAST.

Bron: [CAST (SQL) | InterSystems IRIS Data Platform 2025.3](https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=RSQL_cast#:~:text=The%20SQL%20CAST%20function%20converts,is%20more%20flexible%20than%20CAST.)

## Verwante vragen

- [What is the CAST function in Oracle?](https://1001vragen.nl/vraag/what-is-the-cast-function-in-oracle.md)
- [What does SELECT cast do?](https://1001vragen.nl/vraag/what-does-select-cast-do.md)
- [How to write a cast statement in SQL?](https://1001vragen.nl/vraag/how-to-write-a-cast-statement-in-sql.md)
- [How to cast a bit in SQL?](https://1001vragen.nl/vraag/how-to-cast-a-bit-in-sql.md)
- [How to use the CAST function in SQL?](https://1001vragen.nl/vraag/how-to-use-the-cast-function-in-sql.md)
- [What is the use of the cast() function in SQL?](https://1001vragen.nl/vraag/what-is-the-use-of-the-cast-function-in-sql.md)
- [How to cast a datatype in SQL?](https://1001vragen.nl/vraag/how-to-cast-a-datatype-in-sql.md)
- [How to use CAST function in Oracle?](https://1001vragen.nl/vraag/how-to-use-cast-function-in-oracle.md)
- [What is the cast method in SQL?](https://1001vragen.nl/vraag/what-is-the-cast-method-in-sql.md)
- [Which clause is used to find a pattern in character data?](https://1001vragen.nl/vraag/which-clause-is-used-to-find-a-pattern-in-character-data.md)
