Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server 2005 DateTime (return only hh:mm)

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 using this but it returns seconds.

 CONVERT(VARCHAR(8), tbltime.Time, 108) AS [Time]

Any ideas to remove the seconds?

like image 746
pikk Avatar asked Feb 28 '12 12:02

pikk


Video Answer


1 Answers

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

CONVERT(VARCHAR(5),tbltime.Time,108) AS [Time]
like image 125
AdaTheDev Avatar answered Sep 22 '22 02:09

AdaTheDev