Created
January 27, 2012 20:44
-
-
Save niczak/1690828 to your computer and use it in GitHub Desktop.
Monthly Employee Charges [CR Vars Left In]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select e.last_name, e.first_name, e.display_employee, e.other_string3, ld3.short_description proj_desc, ld1.ld1 account_id, ld1.short_description account_name, ld3.ld1 project, | |
sum(tso.pay) as salary, sum(tso.calc_value2) as fringe, sum(tso.calc_value4) as fringe_icr | |
from time_sheet_output tso, | |
employee_periods ep, | |
employee e, | |
ld3, | |
ld1 | |
where e.employee = ep.employee | |
and (' All' in ({?STD_DEPARTMENT_SQL}) or ld1.ld1 in ({?STD_DEPARTMENT_SQL})) | |
and (' All' in ({?DRI_EMPLOYEE_TYPE_SQL}) or e.other_string3 in ({?DRI_EMPLOYEE_TYPE_SQL})) | |
and tso.ld3 = ld3.ld1 | |
and tso.ld1 = ld1.ld1 | |
and tso.work_dt between ld1.eff_dt and ld1.end_eff_dt | |
and tso.work_dt between ld3.eff_dt and ld3.end_eff_dt | |
and tso.transaction_type in (30, 40) | |
and tso.employee_period_version = ep.calc_emp_period_version | |
and tso.work_dt between e.eff_dt and e.end_eff_dt | |
and tso.work_dt between {?STD_START_DATE_SQL} and {?STD_END_DATE_SQL} | |
and ({?STD_START_DATE_SQL} between ep.pp_begin and ep.pp_end | |
or {?STD_END_DATE_SQL} between ep.pp_begin and ep.pp_end | |
or ep.pp_begin between {?STD_START_DATE_SQL} and {?STD_END_DATE_SQL}) | |
group by e.last_name, e.first_name, e.display_employee, ld1.ld1, ld1.short_description, ld3.short_description, ld3.ld1, e.other_string3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment