A little involved It would be easiest to turn to this SQL script, which I created for you, which gives an accurate result. There are ways you can improve it in terms of performance or other considerations, but hopefully this should be at least clearer than some alternatives.
The bottom line is that you first get the canonical ranking of your data, then use it to segment the data into groups, then find the end date for each group, and then delete all the intermediate lines. ROW_NUMBER () and CROSS APPLY help a lot with this.
EDIT 2019:
For some reason, the SQL Fiddle does seem broken, but on the SQL Fiddle site, it seems to be a problem. Here is the full version just tested on SQL Server 2016:
CREATE TABLE Source ( EmployeeID int, DateStarted date, DepartmentID int ) INSERT INTO Source VALUES (10001,'2013-01-01',001), (10001,'2013-09-09',001), (10001,'2013-12-01',002), (10001,'2014-05-01',002), (10001,'2014-10-01',001), (10001,'2014-12-01',001) SELECT *, ROW_NUMBER() OVER (PARTITION BY EmployeeID ORDER BY DateStarted) AS EntryRank, newid() as GroupKey, CAST(NULL AS date) AS EndDate INTO