# How to use convert() in SQL?

- data_type(length) specifies the target data type.
- expression is the value you're converting.
- style is optional and applies mostly to date and time conversions.

Bron: [CONVERT(data_type(length), expression, style)](https://mimo.org/glossary/sql/convert-function)

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

## How to use convert function in SQL?

- data_type(length) specifies the target data type.
- expression is the value you're converting.
- style is optional and applies mostly to date and time conversions.

Bron: [CONVERT(data_type(length), expression, style)](https://mimo.org/glossary/sql/convert-function)

## How to convert date format from dd mm yyyy to yyyymmdd in SQL?

For the data load to convert the date to 'yyyymmdd' format, I will use CONVERT(CHAR(8), TheDate, 112). Format 112 is the ISO standard for yyyymmdd. Results: Example SQL Server dates loaded.

Bron: [SQL Convert Date to YYYYMMDD](https://www.mssqltips.com/sqlservertip/6452/sql-convert-date-to-yyyymmdd/#:~:text=For%20the%20data%20load%20to,the%20ISO%20standard%20for%20yyyymmdd.&text=Results%3A%20Example%20SQL%20Server%20dates%20loaded.)

## What does convert mean in SQL?

The CONVERT() function converts a value into the specified datatype or character set.

Bron: [MySQL CONVERT() Function - W3Schools](https://www.w3schools.com/sql/func_mysql_convert.asp#:~:text=The%20CONVERT()%20function%20converts,specified%20datatype%20or%20character%20set.)

## Verwante vragen

- [How to convert string to integer in PostgreSQL?](https://1001vragen.nl/vraag/how-to-convert-string-to-integer-in-postgresql.md)
- [How to convert date into integer in SQL?](https://1001vragen.nl/vraag/how-to-convert-date-into-integer-in-sql.md)
- [How to convert data type in SQL Server?](https://1001vragen.nl/vraag/how-to-convert-data-type-in-sql-server.md)
- [How to convert character to numeric in SQL?](https://1001vragen.nl/vraag/how-to-convert-character-to-numeric-in-sql.md)
- [How to convert char to number in PL/SQL?](https://1001vragen.nl/vraag/how-to-convert-char-to-number-in-pl-sql.md)
- [How to use concat in select query?](https://1001vragen.nl/vraag/how-to-use-concat-in-select-query.md)
- [How to concatenate two strings?](https://1001vragen.nl/vraag/how-to-concatenate-two-strings.md)
- [How to concat special characters in SQL?](https://1001vragen.nl/vraag/how-to-concat-special-characters-in-sql.md)
- [How to concat two variables in SQL?](https://1001vragen.nl/vraag/how-to-concat-two-variables-in-sql.md)
- [How to fix typeerror can only concatenate str not int to str?](https://1001vragen.nl/vraag/how-to-fix-typeerror-can-only-concatenate-str-not-int-to-str.md)
