Tricky Grouping problem!

5 pts.
Tags:
SQL
SQL Database
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!

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: