sql 获取时间函数 convert

Syntax for CAST:
CAST ( expression AS data_type [ (length ) ])

Syntax for CONVERT:
CONVERT ( data_type [ ( length ) ] , expression [ , style ] )

-----------------------------------------------------------------

select convert(varchar(50),getdate(),112)

-----------------------------------------------------------------

out:20081127

你可能感兴趣的:(sql,server)