02-21-2013, 04:39 AM
02-22-2013, 09:43 AM
1. Employee joined between two dates
select
b.full_name,
b.applicant_number,
a.current_employer,
d.name job,
e.date_start Actual_DOJ,
b.business_group_id
from
per_applications a,
per_all_people_f b,
per_all_assignments_f c,
per_jobs d,
per_periods_of_service e
where 1=1
and a.person_id(+) = b.person_id
and b.person_id = c.person_id
and trunc(sysdate) between b.effective_start_date and b.effective_end_date
and trunc(sysdate) between c.effective_start_date and c.effective_end_date
and C.JOB_ID = D.JOB_ID(+)
and E.PERSON_ID = B.PERSON_ID
and e.date_start between to_date('01-JAN-2013','DD-MON-YYYY') and to_date('31-JAN-2013','DD-MON-YYYY')
2. Employees left between two dates
select
b.full_name,
b.applicant_number,
a.current_employer,
d.name job,
e.date_start Actual_DOJ,
b.business_group_id
from
per_applications a,
per_all_people_f b,
per_all_assignments_f c,
per_jobs d,
per_periods_of_service e
where 1=1
and a.person_id(+) = b.person_id
and b.person_id = c.person_id
and trunc(sysdate) between b.effective_start_date and b.effective_end_date
and trunc(sysdate) between c.effective_start_date and c.effective_end_date
and C.JOB_ID = D.JOB_ID(+)
and E.PERSON_ID = B.PERSON_ID
and e.date_start between to_date('01-JAN-2013','DD-MON-YYYY') and to_date('31-JAN-2013','DD-MON-YYYY')
select
b.full_name,
b.applicant_number,
a.current_employer,
d.name job,
e.date_start Actual_DOJ,
b.business_group_id
from
per_applications a,
per_all_people_f b,
per_all_assignments_f c,
per_jobs d,
per_periods_of_service e
where 1=1
and a.person_id(+) = b.person_id
and b.person_id = c.person_id
and trunc(sysdate) between b.effective_start_date and b.effective_end_date
and trunc(sysdate) between c.effective_start_date and c.effective_end_date
and C.JOB_ID = D.JOB_ID(+)
and E.PERSON_ID = B.PERSON_ID
and e.date_start between to_date('01-JAN-2013','DD-MON-YYYY') and to_date('31-JAN-2013','DD-MON-YYYY')
2. Employees left between two dates
select
b.full_name,
b.applicant_number,
a.current_employer,
d.name job,
e.date_start Actual_DOJ,
b.business_group_id
from
per_applications a,
per_all_people_f b,
per_all_assignments_f c,
per_jobs d,
per_periods_of_service e
where 1=1
and a.person_id(+) = b.person_id
and b.person_id = c.person_id
and trunc(sysdate) between b.effective_start_date and b.effective_end_date
and trunc(sysdate) between c.effective_start_date and c.effective_end_date
and C.JOB_ID = D.JOB_ID(+)
and E.PERSON_ID = B.PERSON_ID
and e.date_start between to_date('01-JAN-2013','DD-MON-YYYY') and to_date('31-JAN-2013','DD-MON-YYYY')
09-12-2013, 08:06 PM
Good Post........Keep it Up Good Work.
Regards,
Surendra
Regards,
Surendra