Alibabacloud.com offers a wide variety of articles about sql convert varchar to float example, easily find your sql convert varchar to float example information here online.
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
ConvertExplicitly converts a data type expression to another data type. Because some requirements often use different date formats, the following can be found inFormat the date in SQL Server.
SQL Server supports the data format in the Arabic style
Processing of date data format:
Result of convert (varchar (16), time 1, 20): 2007-02-01 08: 02
Result of convert (varchar (10), time 1, 23): 2007-02-01
Statement and query result:Select convert (varchar (100), getdate (), 0): 05 16 2006
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
Convert function [data type conversion]
--------------------------------------------------------------------------------
FunctionReturns the expression converted to the provided data type.
SyntaxConvert (data type, expression [, format-style])
Format:Convert(Data_type, expression[, Style])Convert(Varchar, field name,Format type)
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
Original: http://www.2cto.com/database/201310/250880.htmlSQL cast and CONVERT usage detailed Summary: The following applies only to Mysqlselect {fn CONCAT (CONVERT (User_id,char), user_name)} as Str from T_SYS_ User following this applies only to
In the project, the float type is used to define some columns, such as price, but many problems are found.1. When the number of bits on the value is greater than 6, the float type is converted to the varchar type, which is displayed in the
SyntaxUse CAST:
CAST (expression AS data_type)
Use CONVERT:
CONVERT (data_type [(length)], expression [, style])
ParametersExpression
Is any valid Microsoft SQL Server "expression. For more information, see expressions.
Data_type
The data types
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.