H
homerj0216
I need some help with the following problem.
I have a list of users. Each of those users has a span of service dates. I
need to consolidate the list for each user so that service dates that are
consecutive create a new set of service dates, such that the new service
dates start at the first service date and run through the last service date.
Here is an example of what I mean:
User1 has service dates 09-01 to 09-18
User1 has service dates 09-19 to 10-01
User1 has service dates 10-01 to 10-15
User1 has service dates 11-01 to 11-15
I need a way to consolidate the service dates for this user so that the
service dates are 09-01 to 10-15 for the first three (thus consolidating
three rows into one row), and then counts the last set of service dates as a
separate service date range. It should account for the fact that some
service dates overlap (as the second service end date matches the third start
date), but should also account for dates that are consecutive but not
overlapping (as the first end date is consecutive to the second start date).
So, for User1, I would end up with the following rows of data:
User1 has service dates 09-01 to 10-15
User1 has service dates 11-01 to 11-15.
Any help is appreciated!
Thanks,
Mike
I have a list of users. Each of those users has a span of service dates. I
need to consolidate the list for each user so that service dates that are
consecutive create a new set of service dates, such that the new service
dates start at the first service date and run through the last service date.
Here is an example of what I mean:
User1 has service dates 09-01 to 09-18
User1 has service dates 09-19 to 10-01
User1 has service dates 10-01 to 10-15
User1 has service dates 11-01 to 11-15
I need a way to consolidate the service dates for this user so that the
service dates are 09-01 to 10-15 for the first three (thus consolidating
three rows into one row), and then counts the last set of service dates as a
separate service date range. It should account for the fact that some
service dates overlap (as the second service end date matches the third start
date), but should also account for dates that are consecutive but not
overlapping (as the first end date is consecutive to the second start date).
So, for User1, I would end up with the following rows of data:
User1 has service dates 09-01 to 10-15
User1 has service dates 11-01 to 11-15.
Any help is appreciated!
Thanks,
Mike