views:

28

answers:

2

Hi all... I want only Hr and Min in time format so i did

select convert(varchar(20),GETDATE(),108) ===>> output is "12:57:54"

but i want only "12:57" this much so how i will do that in sql server

A: 

Select cast(DatePart(hour, getdate()) as varchar(2)) + ':' + cast(DatePart(minute, getdate())as varchar(2))

Barry
+1  A: 

select convert(varchar(5),GETDATE(),108)

Muhammad Kashif Nadeem