原始 SQL 语句是:
The Original SQL Statement is:
SELECT SA.[RequestStartDate] as 'Service Start Date',
SA.[RequestEndDate] as 'Service End Date',
FROM
(......)SA
WHERE......
输出日期格式为 YYYY/MM/DD,但我希望输出日期格式为 DD/MM/YYYY.我如何修改此声明?
The output date format is YYYY/MM/DD, but I want the output date format is DD/MM/YYYY. How can I modify in this statement?
试试这个...
select CONVERT (varchar(10), getdate(), 103) AS [DD/MM/YYYY]
更多信息:http://www.sql-server-helper.com/tips/date-formats.aspx
这篇关于在 SQL SELECT 语句中更改日期格式(DD/MM/YYYY)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
Sql server 表使用情况统计Sql server table usage statistics(Sql server 表使用情况统计)
t sql中的相对路径?Relative path in t sql?(t sql中的相对路径?)
在 WHERE 条件下获取 SQL 中的最后一条记录Getting the last record in SQL in WHERE condition(在 WHERE 条件下获取 SQL 中的最后一条记录)
在 SQL Server 中使用 FOR XML PATH 查询以获取分层数据Query to get XML output for hierarchical data using FOR XML PATH in SQL Server(在 SQL Server 中使用 FOR XML PATH 查询以获取分层数据的 XML
嵌入在 sum() 函数中的 T-SQL IF 语句T-SQL IF statement embedded in a sum() function(嵌入在 sum() 函数中的 T-SQL IF 语句)
表与临时表性能Table vs Temp Table Performance(表与临时表性能)