select (select max([date]) where [date]<'2005-1-1 17:00:00') as [min],
(select min([date]) where [date]>'2005-1-1 17:00:00') as [max]
from tb a