Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Display Hours in HH:MM format

Author  Topic 

notes4we
Yak Posting Veteran

90 Posts

Posted - 2008-10-06 : 11:55:03
Currently I have a column Column1 in SQL Table1 that has datatype datetime, where the data is displayed as 1899/12/30 4:59:00 PM.

I have a query:
CONVERT(varchar(8), dbo.Table1.Column1,8) AS HoursUpdation

This gives me just the Hours as 4:59:00
But I do not want to see the seconds also.
I just want it in the format HH:MM

Can anyone please let me know the way to achieve this?

Thank you,
notes4we

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-06 : 11:58:00
CONVERT(varchar(5), dbo.Table1.Column1,8) AS HoursUpdation

Go to Top of Page

notes4we
Yak Posting Veteran

90 Posts

Posted - 2008-10-06 : 13:33:44
Thank you. It works fine.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-06 : 13:42:58
welcome
Go to Top of Page
   

- Advertisement -