Ok, this has been killing me for a few days.
I have two tables
Number 1:
PK Date
A 1/1/2006
B 2/1/2009
C 3/1/2007
D 5/1/2007
Number 2:
PK Date
A 1/1/2005
A 2/1/2006
A 5/1/2009
B 2/1/2009
B 5/1/2010
C 5/1/2007
D 4/1/2007
So I want a column in table 1 that is the minimum date from table 2 that matches the PK and is >= the date in table 1.
It would return:
A 2/1/2006
B 2/1/2009
C 5/1/2007
D Err or NULL
I think that example kinda covers most of the possibilities here. If anyone has a good solution. Please help!
I have two tables
Number 1:
PK Date
A 1/1/2006
B 2/1/2009
C 3/1/2007
D 5/1/2007
Number 2:
PK Date
A 1/1/2005
A 2/1/2006
A 5/1/2009
B 2/1/2009
B 5/1/2010
C 5/1/2007
D 4/1/2007
So I want a column in table 1 that is the minimum date from table 2 that matches the PK and is >= the date in table 1.
It would return:
A 2/1/2006
B 2/1/2009
C 5/1/2007
D Err or NULL
I think that example kinda covers most of the possibilities here. If anyone has a good solution. Please help!