create table #t(
id int identity(1,1),
dtime datetime
)
insert #t
select '2012-02-11 13:23:06' union all
select '2012-02-10 11:23:06' union all
select '2012-01-19 23:23:06' union all
select '2012-01-18 13:23:06' union all
select '2012-02-09 20:23:06' union all
select '2012-02-11 10:23:06'
select *from #t where dtime<GETDATE()-1 and DATEPART(hh,dtime) < 23