join on just the next closest date? I want to get a table of

[file], [folder], [DateAdded], [DateRemoved]


I have a log table of changes that has 

[file], [ChangeDate], [OldFolder], [NewFolder]


Files have moved in and out of folders multiple time so for the records for a file and folder I need to join the lowest date to the next highest date. I am not exactly sure how to write the SQL Query to do this.
Figured it out

SELECT temp1.[file], temp1.[ChangeDate] AS [AddedDate]
,temp1.[OldFolder]
,temp1.[NewFolder]
,(SELECT MIN(temp2.[ChangeDate])
FROM [Changes] AS temp2
WHERE temp2.[OldFolder] = temp1.[NewFolder]
AND temp2.[ChangeDate] &gt; temp1.[ChangeDate]
AND temp2.[file] = temp1.[file]
) AS [RemovedDate]
FROM [Changes] AS temp1