更新时间:2023-01-30 11:31:39
FORMAT 函数从 2012 版本开始可用.在早期版本中,使用这个:
FORMAT function is available from version 2012 onwards. In earlier versions, use this:
DECLARE @d DATETIME = '01/01/2011';
SELECT replace(replace(' '+convert(varchar(10),@d,101),' 0',''),'/0','/')
然而,格式化是前端应用程序的工作.
However, formatting is the job of the front end application.