I\'m surprised not to be able to find this question here already.
I have a date time var and I want to convert it to a string so that I can append it to another stri
The following query will get the current datetime and convert into string. with the following format yyyy-mm-dd hh:mm:ss(24h)
yyyy-mm-dd hh:mm:ss(24h)
SELECT convert(varchar(25), getdate(), 120)