Click here to Skip to main content
15,867,756 members
Articles / Database Development / SQL Server
Alternative
Tip/Trick

Adding Time in HH:MM Format - Useful SQL Query

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
10 Feb 2012CPOL 5.3K   1  
select aday, code, convert(varchar(5), min(atime), (108))MinTime, convert(varchar(5), max(atime),(108)) MaxTime from testgroup by aday,codeorder by aday asc
SQL
select aday, code, convert(varchar(5), min(atime), (108))MinTime, convert(varchar(5), max(atime),(108)) MaxTime

 from test

group by aday,code
order by aday asc

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Unknown
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --