Skip to content

Instantly share code, notes, and snippets.

@exaucae
Last active April 16, 2021 12:59
Show Gist options
  • Save exaucae/80c45ba2d9dbbc6a3d84d813fa6f0d2d to your computer and use it in GitHub Desktop.
Save exaucae/80c45ba2d9dbbc6a3d84d813fa6f0d2d to your computer and use it in GitHub Desktop.
sql-server-convert
-- From datetime to string
-- The third argument of the convert function specifies the datetime format
DECLARE @date DATETIME = '2020-10-21 17:38:54.840'
BEGIN
SELECT CONVERT(varchar, @date, 115)
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment