Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ad hoc parameter

Status
Not open for further replies.

andy38

Technical User
Feb 9, 2006
1
GB
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 >= :pBeginDate
AND Wo.reportdate <= :pEndDate
and :?pTrade
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top