create table test(LRRQ datetime)
insert test(LRRQ)
select '2006-8-16' union all
select '2006-8-17' union all
select '2006-8-11' union all
select '2006-8-18' union all
select '2006-8-13' union all
select '2006-8-12'
select * from test
go
create proc sp_dt
@dt datetime
as
select top 1 LRRQ from test
where datediff(d,LRRQ,@dt) >=0
order by datediff(d,LRRQ,@dt)
go