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

Query Parameters

Status
Not open for further replies.

metalboy

Technical User
Apr 1, 2004
97
GB
Hi all,
I have a query
Code:
SELECT LHENDT, MQUSER, COUNT(*), ITEGNG  FROM HDPULSE4DX  WHERE (ITSTAT = 'N' AND ITENNG = 0 AND (LHJUCG = 'A' AND LHJVCG IN ('ED','RDH','RGJ','RGD','RGC','RHH','RIH','RKC','RLC','RMC','RNG',
'RPW','RQC','RQD','RQE','RQF','RQG','RQH','RQI','RQJ',...,'RXB') OR LHJUCG = 'D' AND LHJVCG IN ('TW','QW','Q8','Q2','87','88','YU','QY','QLP','QLQ','KIP','QZ','QJ')) AND LHENDT = 1050104 AND MQUSER IN ('EBANKSC','MIDDLEJ','TUTIND','SHARMATA','WEIGHTJ','ASHMORN','COXC'
,'BUTLERK','MCARDLC','SHEPERM','TOLMIEL',...,'WILSONMI') AND ITEGNG = 48)  GROUP BY LHENDT, MQUSER, ITEGNG  ORDER BY 1, 2, 4, 3

This sql connects to an as400 system. i need to cut out the portion below some how.
Code:
MQUSER IN ('EBANKSC','MIDDLEJ','TUTIND','SHARMATA','WEIGHTJ','ASHMORN','COXC',
'SHEPERM','TOLMIEL','BALJ','ADONISA','NIXONS','HUSKINS','HAZIMEG',
'DESAIJ','DEERS','BABERA','REDMONC','PHILIPJ',...,'WILSONMI')

is it possible to have this information in an access table so each user id does not have to be specified in the sql?

thank you for your time and help.
regards

Alex



“It is a mistake to think you can solve any major problems just with potatoes.”
Douglas Adams
 
Take a look at INNER JOIN

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
metalboy,

First I would create another table with a single column (it could be on the AS/400). Next, place your user names in it.

Then do this in your code

Code:
MQUSER IN (Select * from yournewtable)

That will do it!!

Good Luck...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top