SELECT 0 AS ID , Convert(VARCHAR(30), GETDATE(), 0 ) AS result UNION ALL
SELECT 100 AS ID , Convert(VARCHAR(30), GETDATE(), 100) AS result UNION ALL
SELECT 1 AS ID , Convert(VARCHAR(30), GETDATE(), 1 ) AS result UNION ALL
SELECT 101 AS ID , Convert(VARCHAR(30), GETDATE(), 101) AS result UNION ALL
SELECT 2 AS ID , Convert(VARCHAR(30), GETDATE(), 2 ) AS result UNION ALL
SELECT 102 AS ID , Convert(VARCHAR(30), GETDATE(), 102) AS result UNION ALL
SELECT 2 AS ID , Convert(VARCHAR(30), GETDATE(), 2 ) AS result UNION ALL
SELECT 102 AS ID , Convert(VARCHAR(30), GETDATE(), 102) AS result UNION ALL
SELECT 3 AS ID , Convert(VARCHAR(30), GETDATE(), 3 ) AS result UNION ALL
SELECT 103 AS ID , Convert(VARCHAR(30), GETDATE(), 103) AS result UNION ALL
SELECT 4 AS ID , Convert(VARCHAR(30), GETDATE(), 4 ) AS result UNION ALL
SELECT 104 AS ID , Convert(VARCHAR(30), GETDATE(), 104) AS result UNION ALL
SELECT 5 AS ID , Convert(VARCHAR(30), GETDATE(), 5 ) AS result UNION ALL
SELECT 105 AS ID , Convert(VARCHAR(30), GETDATE(), 105) AS result UNION ALL
SELECT 6 AS ID , Convert(VARCHAR(30), GETDATE(), 6 ) AS result UNION ALL
SELECT 106 AS ID , Convert(VARCHAR(30), GETDATE(), 106) AS result UNION ALL
SELECT 7 AS ID , Convert(VARCHAR(30), GETDATE(), 7 ) AS result UNION ALL
SELECT 107 AS ID , Convert(VARCHAR(30), GETDATE(), 107) AS result UNION ALL
SELECT 8 AS ID , Convert(VARCHAR(30), GETDATE(), 8 ) AS result UNION ALL
SELECT 108 AS ID , Convert(VARCHAR(30), GETDATE(), 108) AS result UNION ALL
SELECT 9 AS ID , Convert(VARCHAR(30), GETDATE(), 9 ) AS result UNION ALL
SELECT 109 AS ID , Convert(VARCHAR(30), GETDATE(), 109) AS result UNION ALL
SELECT 10 AS ID , Convert(VARCHAR(30), GETDATE(), 10 ) AS result UNION ALL
SELECT 110 AS ID , Convert(VARCHAR(30), GETDATE(), 110) AS result UNION ALL
SELECT 11 AS ID , Convert(VARCHAR(30), GETDATE(), 11 ) AS result UNION ALL
SELECT 111 AS ID , Convert(VARCHAR(30), GETDATE(), 111) AS result UNION ALL
SELECT 12 AS ID , Convert(VARCHAR(30), GETDATE(), 12 ) AS result UNION ALL
SELECT 112 AS ID , Convert(VARCHAR(30), GETDATE(), 112) AS result UNION ALL
SELECT 13 AS ID , Convert(VARCHAR(30), GETDATE(), 13 ) AS result UNION ALL
SELECT 113 AS ID , Convert(VARCHAR(30), GETDATE(), 113) AS result UNION ALL
SELECT 14 AS ID , Convert(VARCHAR(30), GETDATE(), 14 ) AS result UNION ALL
SELECT 114 AS ID , Convert(VARCHAR(30), GETDATE(), 114) AS result UNION ALL
SELECT 20 AS ID , Convert(VARCHAR(30), GETDATE(), 20 ) AS result UNION ALL
SELECT 120 AS ID , Convert(VARCHAR(30), GETDATE(), 120) AS result UNION ALL
SELECT 21 AS ID , Convert(VARCHAR(30), GETDATE(), 21 ) AS result UNION ALL
SELECT 121 AS ID , Convert(VARCHAR(30), GETDATE(), 121) AS result
执行一下, 然后看看, 喜欢那种格式, 就用哪种格式, 嘻嘻.
修改你自己机器上的: 短日期格式
控制面板-->日期和时间-->更改日期和时间-->更改日历设置-->日期格式(短日期)
(win7、其他系统类似或者是区域设置)
改成你要的格式。
可以用convert 转换格式:
如select CONVERT(varchar(10),getdate(),1);