--Award Number,Award Funder Reference,Award Short Title,Award Status,GMS Actual Award Start Date,GMS Actual Award End Date,Original Funder,GMS Funder Type,GMS Funder Group,Project Number,Project Status,Actual Project Start Date,Actual Project End Date,Project Personnel Name,Project Personnel Role,Project Personnel CID select distinct gaa.award_number as "AwardNumber", --gaa.funding_source_award_number as "Award Funder Reference", replace(gaa.award_short_name,'"','') as "AwardShortTitle", --gaa.status as "Award Status", trunc(to_date (gaa.attribute1, 'YYYY/MM/DD HH24:MI:SS') ) as "AwardStartDate", trunc(to_date(gaa.attribute2, 'YYYY/MM/DD HH24:MI:SS')) as "AwardEndDate", case gaa.type when 'UK IND COM'|| chr(38) ||'PUB CORP' then 'Industry' when 'EU IND COM'|| chr(38) ||'PUB CORP' then 'Industry' when 'O/SEAS IND COM'|| chr(38) ||'PUB CORP' then 'Industry' else nvl(gaa.attribute6, rc.customer_name) end "Funder", gaa.type as "FunderType", case gaa.type when 'UK IND COM'|| chr(38) ||'PUB CORP' then 'Industry' when 'EU IND COM'|| chr(38) ||'PUB CORP' then 'Industry' when 'O/SEAS IND COM'|| chr(38) ||'PUB CORP' then 'Industry' when 'EU CHARITY NOT PEER/NOT OPEN' then 'Charities' when 'EU CHARITY PEER/OPEN' then 'Charities' when 'O/S CHARITY NOT PEER/NOT OPEN' then 'Charities' when 'O/SEAS CHARITY PEER/OPEN' then 'Charities' when 'UK CHARITY NOT PEER/NOT OPEN' then 'Charities' when 'UK CHARITY PEER/OPEN' then 'Charities' when 'EU COMMISSION' then 'Govmt (Inc EU) '|| chr(38) ||' NHS' when 'EU GOVT BODIES' then 'Govmt (Inc EU) '|| chr(38) ||' NHS' when 'UK CENT GOVNT'|| chr(38) ||'LOCAL AUTH' then 'Govmt (Inc EU) '|| chr(38) ||' NHS' when 'UK HEALTH'|| chr(38) ||'HOSP AUTH' then 'Govmt (Inc EU) '|| chr(38) ||' NHS' when 'EU OTHER' then 'Other Sources' when 'OTHER SOURCES' then 'Other Sources' when 'OTH OVERSEAS SOURCES' then 'Other Sources' when 'OST RESEARCH COUNCILS' then 'Research Councils' end as "FunderGroup" , /* rc.customer_name sponsor, ppa.segment1 as "Project Number", ppa.project_status_code as "Project Status", trunc(to_date(ppa.attribute1, 'YYYY/MM/DD HH24:MI:SS')) as "Actual Project Start Date", trunc(to_date(ppa.attribute2, 'YYYY/MM/DD HH24:MI:SS')) as "Actual Project End Date",*/ papf.full_name as "ProjectPersonnelName",pprt.meaning as "ProjectPersonnelRole", papf.employee_number as "ProjectPersonnelCID" from apps.gms_awards_all gaa, apps.ic_ra_customers rc, apps.pa_projects_all ppa, apps.pa_project_players ppp, apps.pa_project_role_types pprt, apps.per_all_people_f papf, bes.ic_gms_credit_percentage igcp where gaa.funding_source_id = rc.customer_id(+) and ppa.project_id = ppp.project_id and ppp.project_role_type = pprt.project_role_type(+) and ppp.person_id = papf.person_id and trunc(sysdate) between nvl (papf.effective_start_date,trunc(sysdate)) and nvl(papf.effective_end_date,sysdate) and gaa.award_id = igcp.award_id and ppp.project_id = igcp.project_id and ppp.person_id = igcp.person_id and ppp.project_role_type = igcp.project_role_type and igcp.award_id is not null and gaa.award_template_flag = 'DEFERRED' and nvl(template_flag,'N') = 'N' and project_type != 'AWARD_PROJECT' and pprt.meaning in ('CO-INVESTIGATOR', 'INVESTIGATOR', 'PRINCIPAL INVESTIGATOR') -- and gaa.award_number = 'WMIH_P44233' order by award_number --, ppa.segment1, employee_number