Hello Everyone,
Below is my query.
In this query, the last 3 conditions in the where class, i have put outer joins. I know it doesn't work in that way and that's the reason it was giving an error but that's the way i want the query to be run to get my results. I tried chaning the query. Is there any way i can tune this query to work? I am not sure if i was able to explain you the issue properly. Please let me know if you have any questions.
Thanks in advance.
SELECT flv.meaning Donation_Name,
ppx.full_name Donator_name,
decode(ddd.processed_flag,
'N',
'No',
'Y',
'Yes') payroll_processed,
to_char(ddd.effective_date,
'Mon YYYY') Effective_Date,
trunc(ddd.creation_date) Donated_Date,
ddd.start_date,
ddd.end_date,
ddd.deduction_date,
hou.name Organization_Name,
hl.location_code Location_Name,
hou.attribute2 Division,
ppx.employee_number,
pax.assignment_number
FROM pay_element_types_x petx,
donations_details ddd,
per_people_x ppx,
fnd_lookup_values flv,
per_all_assignments_f pax,
hr_locations_all hl,
hr_all_organization_units hou
WHERE 1 = 1
AND flv.lookup_type = 'DONATIONS_DETAILS'
AND upper(petx.element_name) = upper(flv.lookup_code)
AND pax.person_id = ppx.person_id
AND pax.organization_id = hou.organization_id
AND pax.location_id = hl.location_id
AND pax.assignment_type = 'E'
AND pax.primary_flag = 'Y'
AND petx.element_type_id = ddd.donation_element_id(+)
AND ppx.person_id = ddd.donator_id(+)
AND ddd.effective_date(+) BETWEEN pax.effective_start_date AND
pax.effective_end_date