Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[SQLServer] 日付の文字列変換 (CONVERT, 111, 108, 120)
DECLARE @d DATETIME = GETDATE();
-- yyyy/MM/dd HH:mm:ss
SELECT CONVERT(NVARCHAR, @d, 111) + ' ' + CONVERT(NVARCHAR, @d, 108)
-- yyyy-MM-dd HH:mm:ss
SELECT CONVERT(NVARCHAR, @d, 120)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment