In SQL Server how do I format getdate() output into YYYYMMDDHHmmSS where HH is 24 hour format?
getdate()
YYYYMMDDHHmmSS
HH
I\'ve got the YYYYMMDD
YYYYMMDD
Another option!
SELECT CONVERT(nvarchar(8), GETDATE(),112) + CONVERT(nvarchar(2),DATEPART(HH,GETDATE())) + CONVERT(nvarchar(2),DATEPART(MI,GETDATE())) + CONVERT(nvarchar(2),DATEPART(SS,GETDATE()));