CONVERT () conversion function in SQL use string to date

Source: Internet
Author: User

1SELECT CONVERT (varchar ( -), GETDATE (),0): to  - 2006 Ten: 57AM2SELECT CONVERT (varchar ( -), GETDATE (),1): to/ -/ . 3SELECT CONVERT (varchar ( -), GETDATE (),2):06.05. - 4SELECT CONVERT (varchar ( -), GETDATE (),3): -/ to/ . 5SELECT CONVERT (varchar ( -), GETDATE (),4):16.05. . 6SELECT CONVERT (varchar ( -), GETDATE (),5): -- to- . 7SELECT CONVERT (varchar ( -), GETDATE (),6): -  to  . 8SELECT CONVERT (varchar ( -), GETDATE (),7): to  -, . 9SELECT CONVERT (varchar ( -), GETDATE (),8):Ten: $: $ TenSELECT CONVERT (varchar ( -), GETDATE (),9): to  - 2006 Ten: $: $: 827AM OneSELECT CONVERT (varchar ( -), GETDATE (),Ten): to- -- .  ASELECT CONVERT (varchar ( -), GETDATE (), One): ./ to/ -  -SELECT CONVERT (varchar ( -), GETDATE (), A):060516  -SELECT CONVERT (varchar ( -), GETDATE (), -): -  to 2006 Ten: $: $:937  theSELECT CONVERT (varchar ( -), GETDATE (), -):Ten: $: $:967  -SELECT CONVERT (varchar ( -), GETDATE (), -):2006- to- - Ten: $: -  -SELECT CONVERT (varchar ( -), GETDATE (), +):2006- to- - Ten: $:47.157  -SELECT CONVERT (varchar ( -), GETDATE (), A): to/ -/ . Ten: $: -AM +SELECT CONVERT (varchar ( -), GETDATE (), at):2006- to- -  -SELECT CONVERT (varchar ( -), GETDATE (), -):Ten: $: -  +SELECT CONVERT (varchar ( -), GETDATE (), -):2006- to- - Ten: $:47.250  ASELECT CONVERT (varchar ( -), GETDATE (), -): to  - 2006 Ten: 57AM atSELECT CONVERT (varchar ( -), GETDATE (),101): to/ -/2006  -SELECT CONVERT (varchar ( -), GETDATE (),102):2006.05. -  -SELECT CONVERT (varchar ( -), GETDATE (),103): -/ to/2006  -SELECT CONVERT (varchar ( -), GETDATE (),104):16.05.2006  -SELECT CONVERT (varchar ( -), GETDATE (), the): -- to-2006  -SELECT CONVERT (varchar ( -), GETDATE (),106): -  to 2006  inSELECT CONVERT (varchar ( -), GETDATE (),107): to  -,2006  -SELECT CONVERT (varchar ( -), GETDATE (),108):Ten: $: the  toSELECT CONVERT (varchar ( -), GETDATE (),109): to  - 2006 Ten: $: the: 437AM +SELECT CONVERT (varchar ( -), GETDATE (), the): to- --2006  -SELECT CONVERT (varchar ( -), GETDATE (),111):2006/ to/ -  theSELECT CONVERT (varchar ( -), GETDATE (), the):20060516  *SELECT CONVERT (varchar ( -), GETDATE (),113): -  to 2006 Ten: $: the:513  $SELECT CONVERT (varchar ( -), GETDATE (), the):Ten: $: the:547 Panax NotoginsengSELECT CONVERT (varchar ( -), GETDATE (), -):2006- to- - Ten: $: the  -SELECT CONVERT (varchar ( -), GETDATE (),121):2006- to- - Ten: $:49.700  theSELECT CONVERT (varchar ( -), GETDATE (),126):2006- to-16t10: $:49.827  +SELECT CONVERT (varchar ( -), GETDATE (), the): -???? ??????1427 Ten: $: the: 907AM ASELECT CONVERT (varchar ( -), GETDATE (),131): -/Geneva/1427 Ten: $: the: 920AM theNote: The second-to-last question appears, seemingly garbled, in fact, the result of the implementation of MSSQL is this//the string is specifically for the date format, such as: 20070405, following the code. Of course, you can also change the name of the column you want to convert +SELECT CONVERT (datetime,'20070405'): --Geneva- to xx:xx:00.000SELECT CONVERT (varchar (Ten), CAST ('20070405'As DateTime), -): --Geneva- to
View Code

Convert () conversion function in SQL use string to date

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.