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 member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.