select tc.emp_id, emp.last_name || ', ' || emp.first_name as name, to_char(d_work_date, 'Month') as pay_period, sum(gros

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

select tc.emp_id, emp.last_name || ', ' || emp.first_name as name, to_char(d_work_date, 'Month') as pay_period, sum(gros

Post by answerhappygod »

select tc.emp_id, emp.last_name || ', ' || emp.first_name as name, to_char(d_work_date, 'Month') as pay_period, sum(gross_pay) as gross_pay
from tc_base tc
left outer join employee emp
on tc.emp_id = emp.emp_id
where 1=1
and tc.d_work_date between '01-MAR-22' and '31-MAR-22'
and tc.cost_type_cd = 3
and tc.cc not between 1300 and 1399
and tc.cc not between 2300 and 2399
and tc.cc not between 3300 and 3399
and tc.cc not between 130000 and 139999
and tc.cc not between 230000 and 239999
and tc.cc not between 330000 and 339999
and tc.cc not in (1899, 2899, 3899, 100899, 200899, 300899)
and tc.job_id in ( select job_id
from job
where 1=1
and ou_id not in (9010,9050)
and
( postal_cd between '80202' and '80211'
or postal_cd between '80216' and '80224'
or postal_cd between '80229' and '80231'
or postal_cd between '80237' and '80249'
)
)
group by tc.emp_id, emp.last_name || ', ' || emp.first_name, to_char(d_work_date, 'Month')
order by pay_period, name
;
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply