SQL convert datetime to string

convert datetime to a string:



 declare @today as datetime 

 select @today = getdate() 

 print '@today = ' + convert(nvarchar, @today, 103) 

 --where 103 is a format code  



ref: http://www.w3schools.com/sql/func_convert.asp

Comments