Loading lesson path
Concept visual
Start at both ends
Convert a value to a DATE datatype:
CONVERT("2017-08-29", DATE);The CONVERT() function converts a value into the specified datatype or character set.
Also look at the CAST() function.
value, type )
value
charset )
Required. The value to convert type Required. The datatype to convert to. Can be one of the following:
Formula
Converts value to DATE. Format: "YYYY - MM - DD"Converts value to DATETIME.
Formula
Format: "YYYY - MM - DD HH:MM:SS"Converts value to DECIMAL. Use the optional M and D parameters to specify the maximum number of digits (M) and the number of digits following the decimal point (D).
Converts value to TIME. Format: "HH:MM:SS"
Converts value to CHAR (a fixed length string)
Converts value to NCHAR (like CHAR, but produces a string with the national character set)
Formula
Converts value to SIGNED (a signed 64 - bit integer)Formula
Converts value to UNSIGNED (an unsigned 64 - bit integer)Converts value to BINARY (a binary string) charset Required. The character set to convert to