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
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
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
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
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
CONVERT (Data_type,expression[,style])CONVERT (varchar (10), field name, conversion format)DescriptionThis style is typically in the time type (Datetime,smalldatetime) and the string type (Nchar,nvarchar,char,varchar)It is only used when converting
CONVERT (Data_type,expression[,style])CONVERT (varchar (10), field name, conversion format)
DescriptionThis style is generally in the type of time (datetime,smalldatetime) and String type (Nchar,nvarchar,char,varchar)When they are converted to each
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
Copy http://www.cnblogs.com/benwu/p/3939044.htmlThe main description is that SQL Server uses convert to obtain datetime date data in the actual operation process, in the actual operation with the SQL Server database using convert to get datetime
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
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.