X
xrbbaker
My team mate used Business Objects to create a report that goes against
Oracle and then sent me the SQL it used to do it. Ultimately I'd like to
embed the SQL in Excel, but I'm trying to run it in Access first, so as to
get better diagnostics. When I try to run the statement I get an error
saying that there is an extra ')', and then the cursor returns to just to the
right of the first (+). Now I had never seen a (+) before, but I found out
that represents and Outer Join in Oracle. I'm guessing that my problem is
that (+) is not valid syntax in Access land. Thus I need to figure out how
to translate to someting Access likes. Problem is all the examples I can
google show LEFT JOIN in the FROM part of the SELECT, not in the WHERE, as it
occurs here, so I'm not sure how to do it.
Can anybody tell me how I can translate the (+) into something Access will
llike?
Thanks very much,
Russ
SELECT
Decode(ADMUSER.PROJPCAT.PROJ_CATG_ID,
'103','CI','104','HB','105','MD','111','DTD','112','NP'),
ADMUSER.RSRC.RSRC_NAME,
ADMUSER.PROJECT.PROJ_SHORT_NAME,
ADMUSER.PROJWBS.WBS_NAME,
ADMUSER.RSRCHOUR.WORK_DATE,
ADMUSER.RSRC.EMPLOYEE_CODE,
Sum ( ADMUSER.RSRCHOUR.HR_CNT )
FROM
ADMUSER.PROJPCAT,
ADMUSER.RSRC,
ADMUSER.PROJECT,
ADMUSER.RSRCHOUR,
ADMUSER.PROJWBS,
ADMUSER.TASKRSRC,
ADMUSER.TASK
WHERE
( ADMUSER.RSRC.RSRC_ID=ADMUSER.RSRCHOUR.RSRC_ID )
AND ( ADMUSER.TASK.TASK_ID(+)=ADMUSER.TASKRSRC.TASK_ID )
AND ( ADMUSER.PROJWBS.PROJ_ID(+)=ADMUSER.TASK.PROJ_ID )
AND ( ADMUSER.TASKRSRC.TASKRSRC_ID(+)=ADMUSER.RSRCHOUR.TASKRSRC_ID )
AND ( ADMUSER.PROJPCAT.PROJ_ID(+)=ADMUSER.PROJECT.PROJ_ID )
AND ( ADMUSER.PROJECT.PROJ_ID(+)=ADMUSER.PROJWBS.PROJ_ID )
AND ( ADMUSER.PROJWBS.PROJ_NODE_FLAG ='Y' OR ADMUSER.RSRCHOUR.PROJ_ID IS
NULL )
AND ( ADMUSER.RSRCHOUR.PROJ_ID IS NOT NULL )
AND (ADMUSER.RSRCHOUR.WORK_DATE>={ts '2007-01-01 00:00:00'})
AND ADMUSER.PROJPCAT.PROJ_CATG_TYPE_ID = 26
AND Decode(ADMUSER.PROJPCAT.PROJ_CATG_ID,
'103','CI','104','HB','105','MD','111','DTD','112','NP') LIKE 'CI'
)
GROUP BY
Decode(ADMUSER.PROJPCAT.PROJ_CATG_ID,
'103','CI','104','HB','105','MD','111','DTD','112','NP'),
ADMUSER.RSRC.RSRC_NAME,
ADMUSER.PROJECT.PROJ_SHORT_NAME,
ADMUSER.PROJWBS.WBS_NAME,
ADMUSER.RSRCHOUR.WORK_DATE,
ADMUSER.RSRC.EMPLOYEE_CODE
Oracle and then sent me the SQL it used to do it. Ultimately I'd like to
embed the SQL in Excel, but I'm trying to run it in Access first, so as to
get better diagnostics. When I try to run the statement I get an error
saying that there is an extra ')', and then the cursor returns to just to the
right of the first (+). Now I had never seen a (+) before, but I found out
that represents and Outer Join in Oracle. I'm guessing that my problem is
that (+) is not valid syntax in Access land. Thus I need to figure out how
to translate to someting Access likes. Problem is all the examples I can
google show LEFT JOIN in the FROM part of the SELECT, not in the WHERE, as it
occurs here, so I'm not sure how to do it.
Can anybody tell me how I can translate the (+) into something Access will
llike?
Thanks very much,
Russ
SELECT
Decode(ADMUSER.PROJPCAT.PROJ_CATG_ID,
'103','CI','104','HB','105','MD','111','DTD','112','NP'),
ADMUSER.RSRC.RSRC_NAME,
ADMUSER.PROJECT.PROJ_SHORT_NAME,
ADMUSER.PROJWBS.WBS_NAME,
ADMUSER.RSRCHOUR.WORK_DATE,
ADMUSER.RSRC.EMPLOYEE_CODE,
Sum ( ADMUSER.RSRCHOUR.HR_CNT )
FROM
ADMUSER.PROJPCAT,
ADMUSER.RSRC,
ADMUSER.PROJECT,
ADMUSER.RSRCHOUR,
ADMUSER.PROJWBS,
ADMUSER.TASKRSRC,
ADMUSER.TASK
WHERE
( ADMUSER.RSRC.RSRC_ID=ADMUSER.RSRCHOUR.RSRC_ID )
AND ( ADMUSER.TASK.TASK_ID(+)=ADMUSER.TASKRSRC.TASK_ID )
AND ( ADMUSER.PROJWBS.PROJ_ID(+)=ADMUSER.TASK.PROJ_ID )
AND ( ADMUSER.TASKRSRC.TASKRSRC_ID(+)=ADMUSER.RSRCHOUR.TASKRSRC_ID )
AND ( ADMUSER.PROJPCAT.PROJ_ID(+)=ADMUSER.PROJECT.PROJ_ID )
AND ( ADMUSER.PROJECT.PROJ_ID(+)=ADMUSER.PROJWBS.PROJ_ID )
AND ( ADMUSER.PROJWBS.PROJ_NODE_FLAG ='Y' OR ADMUSER.RSRCHOUR.PROJ_ID IS
NULL )
AND ( ADMUSER.RSRCHOUR.PROJ_ID IS NOT NULL )
AND (ADMUSER.RSRCHOUR.WORK_DATE>={ts '2007-01-01 00:00:00'})
AND ADMUSER.PROJPCAT.PROJ_CATG_TYPE_ID = 26
AND Decode(ADMUSER.PROJPCAT.PROJ_CATG_ID,
'103','CI','104','HB','105','MD','111','DTD','112','NP') LIKE 'CI'
)
GROUP BY
Decode(ADMUSER.PROJPCAT.PROJ_CATG_ID,
'103','CI','104','HB','105','MD','111','DTD','112','NP'),
ADMUSER.RSRC.RSRC_NAME,
ADMUSER.PROJECT.PROJ_SHORT_NAME,
ADMUSER.PROJWBS.WBS_NAME,
ADMUSER.RSRCHOUR.WORK_DATE,
ADMUSER.RSRC.EMPLOYEE_CODE