A. A review of the syntax format of CONVERT (): convert ([length], [, Style]) second, here is a note of the meaning of style: style is the conversion style number that is provided by the SQL Server system when converting Datatime and smalldatetime
CONVERT (varchar (10), field name, conversion format)CONVERT (nvarchar), count_time,121Convert is a date conversion function, typically in the time type (Datetime,smalldatetime) and the string type (Nchar,nvarchar,char,varchar)The 3 parameters of
This style is generally used only when the time type (datetime, smalldatetime) and string type (nchar, nvarchar, char, varchar) are converted to each other.
This style is generally used only when the time type (datetime, smalldatetime) and string
Asp tutorial. net SQL server date and time format convert conversionOn the client, you can use the tostring () method for formatting:Datetime. now. tostring ("d") returns the standard date format.Datetime. now. tostring ("mm dd, yy") returns the
format:
CONVERT (Data_type,expression[,style])
Description:This style is generally in the type of time (datetime,smalldatetime) and String type (Nchar,nvarchar,char,varchar)
When they are converted to each other.
Example:SELECT CONVERT (varchar)
Asp tutorial. net SQL server Date and Time Format convert ConversionOn the client, you can use the tostring () method for formatting:
Datetime. now. tostring ("d") returns the standard date format.
Datetime. now. tostring ("mm dd, yy") returns
Format:
Convert (data_type, expression [, style])
Note:This style is generally in the time type (datetime, smalldatetime) and string type (nchar, nvarchar, Char, varchar)It is used only when they are converted to each other.
Example:Select
format:
CONVERT (Data_type,expression[,style])
Description:This style is generally in the type of time (datetime,smalldatetime) and String type (Nchar,nvarchar,char,varchar)
When they are converted to each other.
Example:SELECT CONVERT (varchar)
First, review the syntax format of CONVERT (): convert ([length], [, Style])
Second, here pay attention to the meaning of style: style is the conversion of datatime and smalldatetime data to a string by the SQL Server system provided by the
It mainly describes the actual operation process of SQLServer to use convert to obtain datetime date data. In actual operation, converdatabase uses convert to obtain datetime date data. The following examples include conversions of various date
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.