I am trying to migrate some Employee absence data, from one table to another. The data currently looks like:
Employee, Date, Reason
------------------------
dave,01/01/08,sick1
dave,02/01/08,sick1
dave,03/01/08,sick2
dave,04/01/08,sick1
dave,05/01/08,sick1
bob,01/01/08,sick1
bob,02/01/08,sick1
bob,03/01/08,sick3
bob,04/01/08,sick3
bob,05/01/08,sick3
The data needs to group by Employee, Consecutive dates, and reason. Output would look like:
Employee,From,To,Reason
------------------------
dave 01/01/08 02/01/08 sick1
dave 03/01/08 03/01/08 sick2
dave 04/01/08 05/01/08 sick1
bob 01/01/08 02/01/08 sick1
bob 03/01/08 05/01/08 sick3
I'm really struggling with this and would be grateful of any help!
Software/Hardware used:
ASKED:
January 9, 2009 1:53 PM
UPDATED:
January 9, 2009 2:10 PM