SQLServer uses convert to obtain datetime date data

Source: Internet
Author: User
The following articles mainly describe the actual operation process for SQLServer to use convert to obtain datetime date data. In actual operations, converdatabase uses convert to obtain datetime date data, the following examples include conversion of various date formats. Statement and query result: SelectCONVERT (varchar (100), GETDATE (), 0): 05162

The following articles mainly describe the actual operation process of SQL Server to use convert to obtain datetime date data. In actual operation, SQL Server database uses convert to obtain datetime date data, the following examples include conversion of various date formats. Statement and query result: SelectCONVERT (varchar (100), GETDATE (), 0): 05162

The following articles mainly describe the actual operation process of SQL Server to use convert to obtain datetime date data. In actual operation, SQL Server database uses convert to obtain datetime date data, Hong Kong Server, the following examples include conversion of various date formats.

Statement and query result:

  • Select CONVERT (varchar (100), GETDATE (), 0): 05 16 2006 AM
  • Select CONVERT (varchar (100), GETDATE (), 1): 05/16/0
  • SQL Server uses convert to obtain datetime date data. It is a VM in Hong Kong. The following instances include conversion of various date formats.

    Statement and query result:

    Note:

    SQL Server uses convert:

  • CONVERT (data_type [(length)], expression [, style])
  • Parameters

    Expression

    Is any valid Microsoft®SQL Server™Expression ..

    Data_type

    The data types provided by the target system, including bigint and SQL _variant. User-Defined data types cannot be used.

    Length

    Optional parameters of the nchar, nvarchar, char, varchar, binary, or varbinary data type.

    Style

    Date Format style, which converts datetime or smalldatetime data to character data (nchar, nvarchar, char, varchar, nchar, or nvarchar data type); or string format style, to convert float, real, money, or smallmoney data to character data (nchar, nvarchar, char, varchar, nchar, or nvarchar data type ).

    , Server space

    Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.