sql - How to convert DateTime to VarChar - Stack Overflow
Here's some test sql for all the styles. Make nvarchar(max) shorter to trim (e.g. nvarchar(10)) . DECLARE @now datetime SET @now = GETDATE() select convert(nvarchar(MAX), @now, 0) as output, 0 as style union select convert(nvarchar(MAX), @now, 1), 1 union...