这条语句能不能改漂亮点〉?关于日期取得。
SELECT @today = (SELECT LTRIM(RTRIM(CAST(YEAR(GETDATE()) AS CHAR)))+ RIGHT(LTRIM(RTRIM( '0 '+CAST(MONTH(GETDATE()) AS CHAR))),2)+ RIGHT(LTRIM(RTRIM( '0 '+CAST(DAY(GETDATE()) AS CHAR))),2))
------解决方案--------------------select replace(convert(char(10),getdate(),120), '- ', ' ')
------解决方案--------------------SELECT @today = CONVERT(char(10),GETDATE(),112)