CONVERT function syntax: CONVERT(<target data type>, <expression to be converted>, <style>) : Convert « Data Type « SQL Server / T-SQL






CONVERT function syntax: CONVERT(<target data type>, <expression to be converted>, <style>)

 

5>
6>
7> SELECT CONVERT(datetime,(CONVERT(varchar,GETDATE(),112)))
8> GO

-----------------------
2008-08-17 00:00:00.000

(1 rows affected)

 








Related examples in the same category

1.CONVERT() Function Styles
2.Format money (currency)
3.CONVERT(varchar,Date,101)
4.SELECT CONVERT(VarChar(50), @Num, 2)
5.Combine CONVERT() and DATEADD() to format
6.SELECT CONVERT(VarChar(20), 'April 29, 1988')
7.Conversion with CONVERT function for computated value with numbers in list