Syntax

CONVERT(datatype, expression [ , format-style ] )

Parameters

datatype The data type to which the expression is converted.

expression The expression to be converted.

format-style The style code to apply to the outputted value. Use this parameter when converting strings to date or time data types, and
vice versa. The table below shows the supported style codes, followed by a representation of the output format produced by
that style code. The style codes are separated into two columns, depending on whether the century is included in the output
format (for example, 06 versus 2006).