time - Return HH:mm in SQL Server -
i got date , time inside table. wonder if there way return date, count of date, , time. manage date , count of date following query.
select date daterow, count(date) datecount dbname..tblname group date
the value of time inside table hh:mm:ss
wanted return hh:mm
.
sample expectation result
daterow | datecount | timerow
2016-11-10 11 11:35
2016-11-11 3 11:40
if add convert(varchar(5),getdate(),108) timerow
returned value expected result but query capturing current time. wanted display time table.
edit :
i had two different separated column date
, time
inside table. date column date
datatype. time column time
datatype.
my question : how return value of date, count of date, , time in sql?
if want time out of current system time. use query below,
select left(convert (time, sysdatetime()),5);
if time column present in table use query below.
select left(timecolumn,5);
hope helps!
Comments
Post a Comment