Question : Pairing Recent Dates through SQL

I have the following table where I'm trying to match
the date an asset came in, to the date the asset went out.

For instance, I have a query right now that looks like this:

SELECT
      ID, DIRECTION, DATE
FROM MY TABLE
WHERE DIRECTION = 'OUT'

I would like an extra column that puts the most recent IN date
the the relative OUT date.

thoughts?
thanks

ID      DIRECTION      DATE
1      OUT      7/20/2010
1                   NOTHIN'         7/14/2010
1      IN      7/3/2010
1      OUT      6/20/2010
1      IN      5/20/2010
1      OUT      5/5/2010
1      IN      4/12/2010
1      OUT      4/7/2010
1      IN      3/2/2010
2      OUT      2/9/2010
2      IN      1/4/2010
2      OUT      12/3/2009
2      IN      11/30/2009
2      OUT      10/30/2009
2      IN      10/13/2009
2      OUT      9/12/2009
2      IN      9/11/2009
2      OUT      8/19/2009
2      IN      8/13/2009
3      OUT      7/8/2009
3      IN      5/29/2009
3      OUT      4/27/2009
3      IN      4/20/2009
3      OUT      3/29/2009
3      IN      3/14/2009
3      OUT      2/12/2009
3      IN      2/9/2009
3      OUT      1/24/2009
3      IN      1/20/2009

Answer : Pairing Recent Dates through SQL

Random Solutions  
 
programming4us programming4us