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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PS Query - multi prompts/values

Status
Not open for further replies.

jj22171

MIS
Jun 22, 2007
39
CA
My query looks like this:
SELECT A.COMPANY, SUM( B.EARNINGS)
FROM PS_PAY_LN A, PS_PAY_OTHERS B
WHERE B.COMPANY = A.COMPANY
AND B.PAY_END_DT = A.PAY_END_DT
AND B.LINE_NUM = A.LINE_NUM
AND ( A.COMPANY = :1
AND A.PAY_END_DT BETWEEN :2 AND :3
AND B.ERNCD IN ('A','D','X') )
GROUP BY A.COMPANY

Instead of hard-coding the B.ERNCD IN ('A','D','X') , how can it be worked out in a prompt? There is a table (call it Table_C) which may be use for this purpose but I don't how. Table_C has the following records (for example):
fldName ERNCD
F01 A
F01 D
F01 X
F02 C
F02 E
F03 F
F03 G
F03 I

Any suggestion is greatly appreciated.


 
Right, subquery is the proper method.

Steve N.
State of Ohio, MIS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top