SELECT employee.name, Max(ttime.time) AS MaxMintime
FROM employee INNER JOIN ttime ON employee.numbe = ttime.number
GROUP BY employee.name, format(ttime.time,"yyyymmdd")
UNION SELECT employee.name, Min(ttime.time) AS MaxMintime
FROM employee INNER JOIN ttime ON employee.numbe = ttime.number
GROUP BY employee.name, format(ttime.time,"yyyymmdd");