TheInsider
Programmer
Hello,
What I am looking for here may simply be an algorithm, so I could have posted it in another forum, however I am coding this in Access VBA, so I am placing it in this forum.
My problem is that I have a table of Start and End dates, which pertain to a client's employment history. I need a total of time spent working at all jobs for each client. To throw a wrench in the gears (to make this difficult)... if a client has two jobs at the same time, the overlapping or consecutive months do not get added twice.
for example, if a client had 3 placements; A, B, and C...
A = Placement #1 (7 months)
B = Placement #2 (7 months)
C = Placement #3 (4 months)
| = 1 Month
AAAAAAA||||||||||
|||BBBBBBB|||||||
|||||||||||||CCCC
(where farthest left is of the string of A's, B's, or C's is the Start date, and the farthest right is the End Date)
So Placement A and B overlap. The total time for Placement A and B should be 10 months + 4 months for placement C, totalling 14 months.
I already know how to calculate the difference between 2 dates. I have programmer's logic block right now, so I can't think of an easy way to do this with the possibility of an unlimited number of placements.
Rob Marriott
rob@career-connections.net
What I am looking for here may simply be an algorithm, so I could have posted it in another forum, however I am coding this in Access VBA, so I am placing it in this forum.
My problem is that I have a table of Start and End dates, which pertain to a client's employment history. I need a total of time spent working at all jobs for each client. To throw a wrench in the gears (to make this difficult)... if a client has two jobs at the same time, the overlapping or consecutive months do not get added twice.
for example, if a client had 3 placements; A, B, and C...
A = Placement #1 (7 months)
B = Placement #2 (7 months)
C = Placement #3 (4 months)
| = 1 Month
AAAAAAA||||||||||
|||BBBBBBB|||||||
|||||||||||||CCCC
(where farthest left is of the string of A's, B's, or C's is the Start date, and the farthest right is the End Date)
So Placement A and B overlap. The total time for Placement A and B should be 10 months + 4 months for placement C, totalling 14 months.
I already know how to calculate the difference between 2 dates. I have programmer's logic block right now, so I can't think of an easy way to do this with the possibility of an unlimited number of placements.
Rob Marriott
rob@career-connections.net