Convert using CONVERT function ...

Source: Internet
Author: User
Tags date format
function | Convert add convert to query ...
CONVERT (varchar (10), field name, conversion format)

Like what:
Select User_id,convert (varchar), date,11) as date from Tb_user

Conversion format:
0 or month DD yyyy hh:miampm
1 mm/dd/yy
2 YY.MM.DD
3 Dd/mm/yy
4 dd.mm.yy
5 Dd-mm-yy
6 DD Month YY
7 Month Dd,yy
8 HH:MI:SS
9 or 109 month DD yyyy Hh:mi:ss:mmmAMPM
Ten Mm-dd-yy
One YY/MM/DD
Yymmdd
Mm/dd/yyyy
102 YYYY.MM.DD
Dd/mm/yyyy
Dd.mm.yyyy
Dd-mm-yyyy
YYYY DD Month
Month DD,YYYY
108 Hh:mi:ss
Mm-dd-yyyy
Yyyy/mm/dd
112 YYYYMMDD



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.