Created
March 9, 2015 05:10
-
-
Save devlights/993f484c705c6897d8c2 to your computer and use it in GitHub Desktop.
[SQLServer] 日付の文字列変換 (CONVERT, 111, 108, 120)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
参考リソース
http://teabreak.info/%E3%83%A1%E3%83%A2/sql-server-%E6%96%87%E5%AD%97%E5%88%97%E3%81%8B%E3%82%89%E6%97%A5%E4%BB%98%E5%9E%8B%E3%81%B8%E5%A4%89%E6%8F%9B/