기준시간 : 2011-12-14 13:07:49
SELECT CONVERT(VARCHAR, GETDATE(), 1) ' 1' -> 12/14/11
SELECT CONVERT(VARCHAR, GETDATE(), 2) ' 2' -> 11.12.14
SELECT CONVERT(VARCHAR, GETDATE(), 3) ' 3' -> 14/12/11
SELECT CONVERT(VARCHAR, GETDATE(), 4) ' 4' -> 14.12.11
SELECT CONVERT(VARCHAR, GETDATE(), 5) ' 5' -> 14-12-11
SELECT CONVERT(VARCHAR, GETDATE(), 8) ' 8' -> 13:07:49
SELECT CONVERT(VARCHAR, GETDATE(), 9) ' 9' -> 12 14 2011 1:07:49:520PM
SELECT CONVERT(VARCHAR, GETDATE(), 13) ' 13' -> 14 12 2011 13:07:49:520
SELECT CONVERT(VARCHAR, GETDATE(), 14) ' 14' -> 13:07:49:520
SELECT CONVERT(VARCHAR, GETDATE(), 20) ' 20' -> 2011-12-14 13:07:49
SELECT CONVERT(VARCHAR, GETDATE(), 21) ' 21' -> 2011-12-14 13:07:49.520
SELECT CONVERT(VARCHAR, GETDATE(), 22) ' 22' -> 12/14/11 1:07:49 PM
SELECT CONVERT(VARCHAR, GETDATE(), 23) ' 23' -> 2011-12-14
SELECT CONVERT(VARCHAR, GETDATE(), 25) ' 25' -> 2011-12-14 13:07:49.520
SELECT CONVERT(VARCHAR, GETDATE(), 101) '101' -> 12/14/2011
SELECT CONVERT(VARCHAR, GETDATE(), 102) '102' -> 2011.12.14
SELECT CONVERT(VARCHAR, GETDATE(), 103) '103' -> 14/12/2011
SELECT CONVERT(VARCHAR, GETDATE(), 104) '104' -> 14.12.2011
SELECT CONVERT(VARCHAR, GETDATE(), 105) '105' -> 14-12-2011
SELECT CONVERT(VARCHAR, GETDATE(), 111) '111' -> 2011/12/14
SELECT CONVERT(VARCHAR, GETDATE(), 112) '112' -> 20111214
SELECT CONVERT(VARCHAR, GETDATE(), 120) '120' -> 2011-12-14 13:07:49
SELECT CONVERT(VARCHAR, GETDATE(), 121) '121' -> 2011-12-14 13:07:49.520
'SQL' 카테고리의 다른 글
[MSSQL] string 문자열 함수 & 날짜및 시간함수 정리 (0) | 2012.11.08 |
---|---|
[MSSQL] 버전 정보 보기(version information) (0) | 2012.11.05 |
[MSSQL][Tip] DBCC CHECKDB와 CHECKTABLE로 손상된 테이블 복구하기 (0) | 2012.10.17 |
[MSSQL]Clustered Index & Non-Clustered Index (0) | 2012.10.17 |
[MSSQL] 피벗 PIVOT을 이용 세로데이터 가로출력 (0) | 2012.09.26 |