SyntaxFix
Write A Post
Hire A Developer
Questions
There are many different ways to convert a datetime to a string. Here is one way:
convert
datetime
SELECT convert(varchar(25), getdate(), 121) – yyyy-mm-dd hh:mm:ss.mmm
See Demo
Here is a website that has a list of all of the conversions:
How to Format datetime & date in SQL Server