SQL Server 2005 DateTime (return only hh:mm)

后端 未结 2 439
渐次进展
渐次进展 2021-01-06 02:00

I am working on a stored procedure which returns a column of DateTime datatype.

But I want to return only hh:mm with no seconds. I am usin

相关标签:
2条回答
  • 2021-01-06 02:25

    try this:

    select left(CONVERT(VARCHAR(8),getdate(),108),5)
    
    0 讨论(0)
  • 2021-01-06 02:30

    Just change it to convert to VARCHAR(5) instead :)

    CONVERT(VARCHAR(5),tbltime.Time,108) AS [Time]
    
    0 讨论(0)
提交回复
热议问题