Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Closest Date

Author  Topic 

sandesh_moghe
Constraint Violating Yak Guru

310 Posts

Posted - 2001-10-29 : 08:08:23
Hi,
I want to find the closest date.
In my database i have two dates
1. Expected Delivery Date (Buyer)
2. Offered Delivery Date (Seller)

Now, a buyer wants a shipment on say 11/12/2001 (mm/dd/yyyy)
One seller Offers
SellerName Date
A 11/11/2001
B 11/14/2001
C 11/01/2001
D 11/18/2001

Then the SP should return 11/11/2001
If some seller offers say
E 13/11/2001
Here the the datedifference od Seller A and E is same, then in this case SP Should return A(The earlier one.)
Is it possible
Thanx in Advance


---------------------------
Sandesh - The Messanger
   

- Advertisement -