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
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)