05-19-2013 07:46 PM
Based on data could anyone assist me - making program that contains
test_date closest to delivery_date.
Thanks in advance
05-19-2013 10:51 PM
Hi, I figure you should have an 'id' variable in this case, but if you don't, feel free to take it out:
create table want as
select distinct a.* from have a, have b
group by a.id /*I assume you should have one*/, b.delivery_date
05-19-2013 11:40 PM
I have a variable delivery_date with one observation and test_date with 20 observations. I'd like to find the closest date in test_date to delivery_date by find the minimum absolute difference and retain the minimum value.
When I merge the datasets I only get two observations paired up and get missing values for the rest. Would anyone please explain how to go about this with maybe a do loop or...???