[MSSQL] CONVERT
SELECT GETDATE()
=> 2014-12-31 10:30:20.517
SELECT CONVERT(VARCHAR(18) , GETDATE(), 100)
=> 12 31 2014 10:30AM
SELECT CONVERT(VARCHAR(10) , GETDATE(), 101 )
=> 12/31/2014
SELECT CONVERT(VARCHAR(10) , GETDATE(), 102 )
=> 2014.12.31
SELECT CONVERT(VARCHAR(10) , GETDATE(), 103 )
=> 31/12/2014
SELECT CONVERT(VARCHAR(10) , GETDATE(), 104 )
=> 31.12.2014
SELECT CONVERT(VARCHAR(10) , GETDATE(), 105 )
=> 31-12-2014
SELECT CONVERT(VARCHAR(10) , GETDATE(), 106 )
=> 31 12 2014
SELECT CONVERT(VARCHAR(11) , GETDATE(), 107 )
=> 12 31, 2014
SELECT CONVERT(VARCHAR(8) , GETDATE(), 108 )
=> 10:30:20
SELECT CONVERT(VARCHAR(25) , GETDATE(), 109)
=> 12 31 2014 10:30:20:517AM
SELECT CONVERT(VARCHAR(10) , GETDATE(), 110 )
=> 12-31-2014
SELECT CONVERT(VARCHAR(10) , GETDATE(), 111 )
=> 2014/12/31
SELECT CONVERT(VARCHAR(8) , GETDATE(), 112 )
=> 20141231
SELECT CONVERT(VARCHAR(23) , GETDATE(), 113 )
=> 31 12 2014 10:30:20:517
SELECT CONVERT(VARCHAR(12) , GETDATE(), 114 )
=> 10:30:20:517
SELECT CONVERT(VARCHAR, GETDATE(), 120 )
=> 2014-12-31 10:30:20
SELECT REPLACE(REPLACE(REPLACE(CONVERT(VARCHAR, GETDATE(), 120 ),'-',''),' ',''),':','')
=> 20141231103020
=> 2014-12-31 10:30:20.517
SELECT CONVERT(VARCHAR(18) , GETDATE(), 100)
=> 12 31 2014 10:30AM
SELECT CONVERT(VARCHAR(10) , GETDATE(), 101 )
=> 12/31/2014
SELECT CONVERT(VARCHAR(10) , GETDATE(), 102 )
=> 2014.12.31
SELECT CONVERT(VARCHAR(10) , GETDATE(), 103 )
=> 31/12/2014
SELECT CONVERT(VARCHAR(10) , GETDATE(), 104 )
=> 31.12.2014
SELECT CONVERT(VARCHAR(10) , GETDATE(), 105 )
=> 31-12-2014
SELECT CONVERT(VARCHAR(10) , GETDATE(), 106 )
=> 31 12 2014
SELECT CONVERT(VARCHAR(11) , GETDATE(), 107 )
=> 12 31, 2014
SELECT CONVERT(VARCHAR(8) , GETDATE(), 108 )
=> 10:30:20
SELECT CONVERT(VARCHAR(25) , GETDATE(), 109)
=> 12 31 2014 10:30:20:517AM
SELECT CONVERT(VARCHAR(10) , GETDATE(), 110 )
=> 12-31-2014
SELECT CONVERT(VARCHAR(10) , GETDATE(), 111 )
=> 2014/12/31
SELECT CONVERT(VARCHAR(8) , GETDATE(), 112 )
=> 20141231
SELECT CONVERT(VARCHAR(23) , GETDATE(), 113 )
=> 31 12 2014 10:30:20:517
SELECT CONVERT(VARCHAR(12) , GETDATE(), 114 )
=> 10:30:20:517
SELECT CONVERT(VARCHAR, GETDATE(), 120 )
=> 2014-12-31 10:30:20
SELECT REPLACE(REPLACE(REPLACE(CONVERT(VARCHAR, GETDATE(), 120 ),'-',''),' ',''),':','')
=> 20141231103020
留言