Combine CONVERT() and DATEADD() to format : Convert « Data Type « SQL Server / T-SQL






Combine CONVERT() and DATEADD() to format

 

3>
4> SELECT CONVERT(VarChar(20), DATEADD(m, -9, '9-8-1989'), 101)
5> GO

--------------------
12/08/1988

(1 rows affected)

 








Related examples in the same category

1.CONVERT function syntax: CONVERT(<target data type>, <expression to be converted>, <style>)
2.CONVERT() Function Styles
3.Format money (currency)
4.CONVERT(varchar,Date,101)
5.SELECT CONVERT(VarChar(50), @Num, 2)
6.SELECT CONVERT(VarChar(20), 'April 29, 1988')
7.Conversion with CONVERT function for computated value with numbers in list