기타

[MSSQL] 날짜를 YYYYMMDD 로 바꾸기

김모작자 2006. 8. 4. 19:17

자주 쓰는데 잊어먹는... OTL...

 

convert(char(8), getdate(),112)    -> '20130423'
convert(char(10), getdate(), 23) -> '2013-04-23'
convert(char(10), getdate(), 108) -> '12:01:00'