Oracle to MS-Access SQL: -
i'm trying replicate sql code oracle access automate creation of reports. far have been successful having trouble one:
this oracle sql:
select distinct o587265.project_number e587273, o587265.project_name e587274, o587265.project_status_code e587275, o587265.project_manager e587276 ( select p.segment1 project_number, p.name project_name, p.project_status_code, ( select a.full_name apps.per_all_people_f a, apps.pa_project_players_v pm a.person_id = pm.person_id , pm.project_id = p.project_id , pm.role = 'project manager' , a.current_employee_flag = 'y' , a.person_type_id = 1 , sysdate between a.effective_start_date , a.effective_end_date , sysdate between pm.start_date_active(+) , nvl(pm.end_date_active, sysdate) ) project_manager apps.pa_projects_all p p.project_status_code != 'closed' , p.template_flag = 'n' , p.org_id = 5003 ) o587265 order o587265.project_number asc, o587265.project_name asc, o587265.project_manager asc;
and current ms-access version:
select distinct o587265.project_number e587273, o587265.project_name e587274, o587265.project_status_code e587275, o587265.project_manager e587276 ( select p.segment1 project_number, p.name project_name, p.project_status_code, ( select a.full_name ((apps_per_all_people_f inner join apps_pa_project_players_v pm on a.person_id = pm.person_id ) inner join apps_pa_projects_all p on pm.project_id = p.project_id ) pm.role = 'project manager' , a.current_employee_flag = 'y' , a.person_type_id = 1 , date () between a.effective_start_date , a.effective_end_date , date () between pm.start_date_active , iif(isnull(pm.end_date_active), date (), pm.end_date_active) ) project_manager apps_pa_projects_all p p.project_status_code <> 'closed' , p.template_flag = 'n' , p.org_id = 5003 ) o587265 order o587265.project_number asc, o587265.project_name asc, o587265.project_manager asc;
the first 1 runs directly on oracle 11g (sql developer) , works. ms-access 1 seems returning more 1 row in subquery. exhausted knowledge can't seem replicate it.
what doing wrong?
also, (+) operator in oracle sql code?
i've known operator outer (left/right) join never saw being used , not join.
can me?
possibly in translation of oracle's implicit join ms access explicit join, added additional inner join
referencing apps_pa_projects_all table in derived table's subquery project_manager column, replacing alias p. however, subquery correlated outer from
clause's derived table, apps_pa_projects_all original alias p:
consider removing second inner join
, returning correlated where
clause condition:
original
... ( select a.full_name ((apps_per_all_people_f inner join apps_pa_project_players_v pm on a.person_id = pm.person_id) inner join apps_pa_projects_all p on pm.project_id = p.project_id) pm.role = 'project manager' , a.current_employee_flag = 'y' ...
change
... ( select a.full_name apps_per_all_people_f inner join apps_pa_project_players_v pm on a.person_id = pm.person_id pm.project_id = p.project_id , pm.role = 'project manager' , a.current_employee_flag = 'y' ...