Skip to content

CONVERT

  • expr: This refers to the expression or a value, typically a string, that one wishes to convert to a different character set.
  • using transcoding_name: This refers to the target character set to which the value of expr should be converted.
SELECT CONVERT('2022-10-10', DATETIME);
2022-10-10 00:00:00

In the provided SQL query, the CONVERT function is used to convert a string ‘2022-10-10’ into a DATETIME format. The output is the string converted into a DATETIME, which includes the year, month, day, and time (00:00:00).