CONVERT is the SQL function to convert data from one type to another. Some conversions can be done implicity, eg. from int to smallint, from varchar to char. However, others need to be done explicitly, which is where convert comes in.
Now, the statment below converts the date in the field @date from a date format into a 8 character field.
select @MatDate=convert(char(8),@Date1,112)
^ ^
| |
The first part of the ------- |
convert statement is to |
define what the NEW |
data type is to be |
|
This is the column / variable to be ---
converted to the new data type.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.