please can someone help
the following statement does not run when its ad hoc parameter is populated.if it is left blank, it returns all values as normal.
thanks in advance.
andy
SELECT
Wo.wonum,
Wo.reportdate,
Wo.actlabhrs,
Wo.woassignmntqueueid,
Woass.description,
Wo.leadcraft,
La.name,
(CASE WHEN Wo.woassignmntqueueid IS NULL THEN
(SELECT La.name FROM LABOR La WHERE Wo.leadcraft = La.laborcode AND La.iscraft = 'Y')
ELSE (SELECT Woass.description FROM WOASSIGNMNTQUEUE Woass
WHERE Wo.woassignmntqueueid = Woass.woassignmntqueueid) END) Trade, TO_CHAR(Wo.reportdate,'MON YYYY') YearMonth,
TO_CHAR(Wo.reportdate,'YYYY') Year,
TO_CHAR(Wo.reportdate,'MON') Month
FROM WORKORDER Wo, LABOR La, WOASSIGNMNTQUEUE Woass
WHERE La.laborcode (+)= Wo.leadcraft
AND Woass.woassignmntqueueid (+)= Wo.woassignmntqueueid
AND Wo.reportdate >= BeginDate
AND Wo.reportdate <= EndDate
and :?pTrade
the following statement does not run when its ad hoc parameter is populated.if it is left blank, it returns all values as normal.
thanks in advance.
andy
SELECT
Wo.wonum,
Wo.reportdate,
Wo.actlabhrs,
Wo.woassignmntqueueid,
Woass.description,
Wo.leadcraft,
La.name,
(CASE WHEN Wo.woassignmntqueueid IS NULL THEN
(SELECT La.name FROM LABOR La WHERE Wo.leadcraft = La.laborcode AND La.iscraft = 'Y')
ELSE (SELECT Woass.description FROM WOASSIGNMNTQUEUE Woass
WHERE Wo.woassignmntqueueid = Woass.woassignmntqueueid) END) Trade, TO_CHAR(Wo.reportdate,'MON YYYY') YearMonth,
TO_CHAR(Wo.reportdate,'YYYY') Year,
TO_CHAR(Wo.reportdate,'MON') Month
FROM WORKORDER Wo, LABOR La, WOASSIGNMNTQUEUE Woass
WHERE La.laborcode (+)= Wo.leadcraft
AND Woass.woassignmntqueueid (+)= Wo.woassignmntqueueid
AND Wo.reportdate >= BeginDate
AND Wo.reportdate <= EndDate
and :?pTrade