SQL Server 2005 日期时间(仅返回 hh:mm) [英] SQL Server 2005 DateTime (return only hh:mm)
本文介绍了SQL Server 2005 日期时间(仅返回 hh:mm)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在研究一个存储过程,它返回一列 DateTime
数据类型.
I am working on a stored procedure which returns a column of DateTime
datatype.
但我只想返回 hh:mm
没有秒.我正在使用它,但它返回秒.
But I want to return only hh:mm
with no seconds. I am using this but it returns seconds.
CONVERT(VARCHAR(8), tbltime.Time, 108) AS [Time]
有什么办法可以去掉秒数吗?
Any ideas to remove the seconds?
推荐答案
只需将其更改为转换为 VARCHAR(5) 即可:)
Just change it to convert to VARCHAR(5) instead :)
CONVERT(VARCHAR(5),tbltime.Time,108) AS [Time]
这篇关于SQL Server 2005 日期时间(仅返回 hh:mm)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文