Hi All,
Couldnt figure out to obtain the nearest date in query properly.
find below the sample.
Insert Fsample (ESN varchar(10), optn_type int, auditdate datetime)
values('123',2,'2011-1-03')
values('123',11,'2011-2-20')
values('123',2,'2011-03-02')
values('123',2,'2011-4-10')
values('123',11,'2011-5-18')
2=shipdate
11=returndate
result
ESN|Shipdate|returndate
123|2011-01-03|2011-02-02
123|2011-02-20
123|2011-04-10|2011-05-18
Thank you in advance.
Jonel