We help IT Professionals succeed at work.
Get Started

months person is active

sam2929
sam2929 asked
on
95 Views
Last Modified: 2016-02-23
Employee 101 worked two jobs RCD (0,6) shows he worked two jobs

First job RCD =0 and EMPL_STATUS=T he heft 15-08-10

Second Job RCD=6 and EMPL_STATUS=T he left 15-12-12



Records look like this:

EFFDT           EMPLID   RCD   ACTION   START_DT      END_DT     EMPL_STATUS

2007-12-12        101     0     ADL      2007-12-12      null                     A
2014-12-12        101     6     ADL      2014-12-12      null                     A

2015-07-24        101     6     REO      2014-12-12      null                     A

2015-08-12        101     0     ADL      2007-12-12      15-08-10             T



2015-12-24        101     6     TER      2014-12-12      15-12-12     T


Result in two steps

1) Update Active null end_dt termination date


Records look like this:

EFFDT           EMPLID   RCD   ACTION   START_DT      END_DT     EMPL_STATUS

2007-12-12        101     0     ADL      2007-12-12     15-08-10        A--update end_date
2014-12-12        101     6     ADL      2014-12-12     15-12-12        A  --update end_date

2015-07-24        101     6     REO      2014-12-12      null                A

2015-08-12        101     0     ADL      2007-12-12      15-08-10       T



2015-12-24        101     6     TER      2014-12-12      15-12-12     T



2) Want to see how many nonths employee are active for Q3(Starts from October till December)


In this case employee with RCD 6 is active for Q3 for 12 months.


EFFDT           EMPLID   RCD   ACTION   START_DT      END_DT     EMPL_STATUS months_active



2014-12-12        101     6     ADL      2014-12-12     15-12-12      A       12
Comment
Watch Question
Database Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012
Commented:
This problem has been solved!
Unlock 1 Answer and 11 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE