October 6, 2008 at 9:56 am
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
October 6, 2008 at 10:10 am
try this
select LEFT(CONVERT(VARCHAR(8), GetDate(), 8), 5)
October 6, 2008 at 11:36 am
Thank you. I found syntax little more simpler:
CONVERT(varchar(5), dbo.Table1.Column1,8) AS HoursUpdation
Thank you once again for your response too.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply