Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / database / SQL-Server

Adding Time in HH:MM Format - Useful SQL Query

0.00/5 (No votes)
10 Feb 2012CPOL 5.5K  
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)