Professional Documents
Culture Documents
WWW W3schools Com SQL Func Convert ASP
WWW W3schools Com SQL Func Convert ASP
Search w3schools.com HOME HTML C SS XML JAVASC RIPT ASP PHP SQL MORE...
R EFER ENC ES | EXAMPLES | FO R UM
Search
| ABO UT
FREE SCRIPTS INSTALLER WordPress, Drupal, Zen Cart phpBB, Moodle, Gallery Open-Realty, osTicket & More
SQL Basic
SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL HOME Intro Syntax Select Distinct Where And & Or Order By Insert Update Delete
WEB HOSTING Best Web Hosting PHP MySQL Hosting Best Hosting C oupons UK Reseller Hosting C loud Hosting Top Web Hosting $7.95/mo SEO Hosting Premium Website Design WEB BUILDING
Syntax
CONVERT(data_type(length),data_to_be_converted,style)
Where data_type(length) specifies the target data type (with an optional length), data_to_be_converted contains the value to be converted, and style specifies the output format for the date/time. The styles that can be used are: Style ID 100 or 0 101 102 103 Style Format mon dd yyyy hh:miAM (or PM) mm/dd/yy yy.mm.dd dd/mm/yy
New hot app: Facebook Albums To PDF
SQL Demo
SQL Try It
XML Editor - Free Trial! FREE Website BUILDER W3SCHOOLS EXAMS Get C ertified in: HTML, C SS, JavaScript, XML, PHP, and ASP W3SCHOOLS BOOKS New Books: HTML, C SS JavaScript, and Ajax STATISTICS Browser Statistics
SQL Advanced
SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL Top Like Wildcards In Between Alias Joins Inner Join Left Join Right Join Full Join Union
pdfcrowd.com
SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL
Union Select Into Create DB Create Table Constraints Not Null Unique Primary Key Foreign Key Check Default Create Index Drop Alter Increment Views Dates Nulls isnull() Data Types
104 105 106 107 108 109 or 9 110 111 112 113 or 13 114 120 or 20 121 or 21 126 130 131
dd.mm.yy dd-mm-yy dd mon yy Mon dd, yy hh:mm:ss mon dd yyyy hh:mi:ss:mmmAM (or PM) mm-dd-yy yy/mm/dd yymmdd dd mon yyyy hh:mm:ss:mmm(24h) hh:mi:ss:mmm(24h) yyyy-mm-dd hh:mi:ss(24h) yyyy-mm-dd hh:mi:ss.mmm(24h) yyyy-mm-ddThh:mm:ss.mmm(no spaces) dd mon yyyy hh:mi:ss:mmmAM dd/mm/yy hh:mi:ss:mmmAM
Browser Statistics Browser OS Browser Display SHARE THIS PAGE Share with
SQL Functions
SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL SQL Functions avg() count() first() last() max() min() sum() Group By Having ucase() lcase() mid() len() round() now() format()
Example
The following script uses the CONVERT() function to display different formats. We will use the GETDATE() function to get the current date/time:
pdfcrowd.com
SQL Quiz
SQL Quiz
RE P O RT
E RRO R
HO ME
TO P
P RI N T
FO RU M
A BO U T
open in browser
W3Schools is optimized for learning, testing, and training. Examples might be simplified to improve reading and basic understanding. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use and privacy policy. C opyright 1999-2012 by Refsnes Data. All Rights Reserved. New hot app: Facebook Albums To PDF PRO version Are you a developer? Try out the HTML to PDF API
pdfcrowd.com
pdfcrowd.com